Distributed storage system with web services client interface

ABSTRACT

A distributed, web-services based storage system. A system may include a web services interface configured to receive, according to a web services protocol, a given client request for access to a given data object, the request including a key value corresponding to the object. The system may also include storage nodes configured to store replicas of the objects, where each replica is accessible via a respective unique locator value, and a keymap instance configured to store a respective keymap entry for each object. For the given object, the respective keymap entry includes the key value and each locator value corresponding to replicas of the object. A coordinator may receive the given client request from the web services interface, responsively access the keymap instance to identify locator values corresponding to the key value and, for a particular locator value, retrieve a corresponding replica from a corresponding storage node.

PRIORITY DATA

This application is a divisional of U.S. patent application Ser. No.14/887,228, filed Oct. 19, 2015, which is a continuation of U.S. patentapplication Ser. No. 13/791,414, filed Mar. 8, 2013, now U.S. Pat. No.9,166,863, which is a continuation of U.S. application Ser. No.13/470,531, filed May 14, 2012, now U.S. Pat. No. 9,009,111, which is acontinuation of U.S. application Ser. No. 13/040,941, filed Mar. 4,2011, now U.S. Pat. No. 8,185,497, which is a continuation of U.S.application Ser. No. 12/729,158, filed Mar. 22, 2010, now U.S. Pat. No.7,904,423, which is a continuation of U.S. application Ser. No.11/371,304, filed Mar. 8, 2006, now U.S. Pat. No. 7,716,180, whichclaims priority to U.S. Provisional Patent Application Ser. No.60/754,726 filed Dec. 29, 2005, and which are herein incorporated byreference in their entirety.

BACKGROUND OF THE INVENTION Field of the Invention

This invention relates to data storage systems and, more particularly,to storage systems configured to provide access to storage as a webservice.

Description of the Related Art

Many different computing applications rely on some type of storagemedium for the persistent storage of various kinds of application data.For example, common office applications and multimedia applicationsgenerate and use application data of various types and formats, such asdocuments, spreadsheets, still images, audio and video data, amongothers. Frequently, such data is stored for repeated access or use onbehalf of a user. For example, a user may wish to store and work with anumber of documents or other data over a period of time, and may expectthat the data will be readily available in a predictable state whenneeded.

In conventional computing systems, the storage medium used byapplications for persistent application data storage is most commonly amagnetic fixed drive or “hard drive,” although optical and solid-statestorage devices are also used. Such devices are either integrated withina computer system that executes the applications or accessible to thatsystem via a local peripheral interface or a network. Typically, devicesthat serve as application storage are managed by an operating systemthat manages device-level behavior to present a consistent storageinterface, such as a file system interface, to various applicationsneeding storage access.

This conventional model of application storage presents severallimitations. First, it generally limits the accessibility of applicationdata. For example, if application data is stored on the local hard driveof a particular computer system, it may be inaccessible to applicationsexecuting on other systems. Even if the data is stored on anetwork-accessible device, applications that execute on systems outsidethe immediate network may not be able to access that device. Forexample, for security reasons, enterprises commonly restrict access totheir local area networks (LANs) such that systems external to theenterprise cannot access systems or resources within the enterprise.Thus, applications that execute on portable devices (e.g., notebook orhandheld computers, personal digital assistants, mobile telephonydevices, etc.) may experience difficulty accessing data that ispersistently associated with fixed systems or networks.

The conventional application storage model also may fail to adequatelyensure the reliability of stored data. For example, conventionaloperating systems typically store one copy of application data on onestorage device by default, requiring a user or application to generateand manage its own copies of application data if data redundancy isdesired. While individual storage devices or third-party software mayprovide some degree of redundancy, these features may not beconsistently available to applications, as the storage resourcesavailable to applications may vary widely across applicationinstallations. The operating-system-mediated conventional storage modelmay also limit the cross-platform accessibility of data. For example,different operating systems may store data for the same application indifferent, incompatible formats, which may make it difficult for usersof applications executing on one platform (e.g., operating system andunderlying computer system hardware) to access data stored byapplications executing on different platforms.

SUMMARY

Various embodiments of a distributed, web-services based storage systemare disclosed. According to one embodiment, a system may include a webservices interface configured to receive, according to a web servicesprotocol, client requests for access to data objects. A given clientrequest for access to a given data object may include a key valuecorresponding to the given data object. The system may also include anumber of storage nodes configured to store replicas of the dataobjects, where each replica is accessible via a respective locatorvalue, and where each of the locator values is unique within the system.The system may further include a keymap instance configured to store arespective keymap entry for each of the data objects, where for thegiven data object, the respective keymap entry includes the key valueand each locator value corresponding to each stored replica of the givendata object. The system may also include a coordinator configured toreceive the client requests for access to the data objects from the webservices interface. In response to the given client request, thecoordinator may be configured to access the keymap instance to identifyone or more locator values corresponding to the key value and, for aparticular locator value, to access a corresponding storage node toretrieve a corresponding replica.

In a particular implementation of the system, the web services interfacemay be further configured to receive, according to the web servicesprotocol, client requests to store data objects, where a particularclient request to store a particular data object includes a key valuecorresponding to the particular data object. The coordinator may befurther configured to receive the client requests to store data objectsfrom the web services interface, and in response to the particularclient request, the coordinator may be configured to store one or morereplicas of the particular data object to one or more correspondingstorage nodes. In response to storing a given replica of the particulardata object, a given storage node may be configured to return a locatorvalue corresponding to the given replica to the coordinator.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a block diagram illustrating one embodiment of a storage modelfor presenting storage to users as a web service.

FIG. 2 is a block diagram illustrating one embodiment of a storageservice system architecture.

FIG. 3 is a block diagram illustrating one embodiment of a physicaldeployment of storage service system components.

FIG. 4 is a block diagram illustrating one embodiment of a storage node.

FIG. 5 is a block diagram illustrating one embodiment of data structuresconfigured to organize data objects within a storage node.

FIG. 6 is a flow diagram illustrating one embodiment of a method ofperforming an object get operation.

FIG. 7 is a flow diagram illustrating one embodiment of a method ofperforming an object put operation.

FIG. 8 is a flow diagram illustrating one embodiment of a method ofperforming an object release operation.

FIG. 9 is a flow diagram illustrating one embodiment of a method ofrepacking an object storage space.

FIG. 10 is a block diagram illustrating one embodiment of a set ofkeymap instance data structures.

FIGS. 11A-D illustrate one embodiment of a hierarchical implementationof a keymap instance.

FIG. 12 is a block diagram summarizing relationships among hierarchicallayers within a keymap instance.

FIG. 13 is a flow diagram illustrating one embodiment of a method ofperforming a keymap entry put operation.

FIG. 14 is a flow diagram illustrating one embodiment of a method ofperforming a keymap entry get operation.

FIG. 15A is a flow diagram illustrating one embodiment of a method ofsynchronizing keymap instances using update propagation.

FIG. 15B is a flow diagram illustrating one embodiment of a method ofsynchronizing keymap instances using an anti-entropy protocol.

FIG. 16 is a block diagram illustrating one embodiment of a replicatorkeymap entry.

FIG. 17 illustrates one embodiment of an unbalanced index datastructure.

FIG. 18 illustrates one embodiment of an index node for use in anunbalanced data structure.

FIG. 19 illustrates one embodiment of a stratified index data structure.

FIG. 20 is a flow diagram illustrating one embodiment of a method oftraversing an unbalanced index data structure.

FIG. 21 is a flow diagram illustrating one embodiment of a method ofprocessing a FINGERPRINT anti-entropy protocol message.

FIG. 22 is a flow diagram illustrating one embodiment of a method ofprocessing a FILTER anti-entropy protocol message.

FIG. 23 illustrates one embodiment of a discovery and failure detectiondaemon (DFDD).

FIG. 24 illustrates one embodiment of a global operational state machinethat may be maintained by a DFDD instance.

FIG. 25 is a flow diagram illustrating one embodiment of a method ofsynchronizing DFDD instances according to a gossip-based protocol.

FIG. 26 is a flow diagram illustrating one embodiment of a method ofoperation of storage classes within a storage service system.

FIG. 27 is a flow diagram illustrating one embodiment of a method ofdynamically determining a write plan for storing one or more replicas ofa data object according to current state information of storage nodes.

FIG. 28 is a flow diagram illustrating one embodiment of dynamicallydetermining a write plan with respect to an object for which one or morereplicas have already been stored among storage nodes.

FIG. 29 is a flow diagram illustrating an exemplary embodiment of acomputer system.

While the invention is susceptible to various modifications andalternative forms, specific embodiments thereof are shown by way ofexample in the drawings and will herein be described in detail. Itshould be understood, however, that the drawings and detaileddescription thereto are not intended to limit the invention to theparticular form disclosed, but on the contrary, the intention is tocover all modifications, equivalents and alternatives falling within thespirit and scope of the present invention as defined by the appendedclaims.

DETAILED DESCRIPTION OF EMBODIMENTS Introduction

As computing applications become more data intensive as well asgeographically dispersed, the need for reliable, location-independentaccess to application data increases. For example, multimediaapplications, such as authoring, storage and playback applications,require escalating amounts of data storage as the quality and quantityof multimedia content improves. Further, it may be desirable to accessapplication data from a variety of locations irrespective of thelocation of the device storing the data. For example, while manycomputers include substantial amounts of disk-based storage, accessingsuch storage remotely in a uniform and convenient manner presentstechnical and security difficulties.

In contrast to configuring individual computers to rely solely on theirown internal storage resources or provisioning local network-basedstorage resources (e.g., Network Attached Storage (NAS), Storage AreaNetwork (SAN), etc.), an Internet-connected data storage service may beconfigured to provide generic storage services to clients viaInternet-based protocols, such as web services (WS) protocols, forexample. Internet-based protocols such as web services protocols aretypically platform-independent, in that they typically functionindependently of underlying software or hardware. Consequently,providing data storage capabilities as web services may afford manydifferent types of applications straightforward access to arbitraryamounts of storage independent of the storage resources implementedwithin the applications' host systems or on local networks.Additionally, web service-accessible storage may generally be accessiblefrom any location that provides Internet access. Web service-accessiblestorage may facilitate implementation of a number of different computingfeatures, such as remote access to common data by different devices orapplications, remote access to widely distributed data by individualapplications during execution, access to and/or sharing of data amongdistributed users working in collaboration, dissemination of applicationresult data among distributed users, and many other similar features.

In the following discussion, one embodiment of a possible data storagemodel that may be used in a web services-based storage system isdescribed. Subsequently, a storage service system that may be configuredto provide storage services according to the data storage model isdisclosed, and its various components are described in detail.

Overview of Storage Service User Interface and Storage Model

One embodiment of a storage model for providing data storage to users asa service, such as a web service, is illustrated in FIG. 1. In theillustrated model, storage service interface 10 is provided as acustomer- or user-facing interface to the storage service. According tothe model presented to a user by interface 10, the storage service maybe organized as an arbitrary number of buckets 20 a-n accessible viainterface 10. Each bucket 20 may be configured to store an arbitrarynumber of objects 30 a-n, which in turn may store data specified by auser of the storage service.

As described in greater detail below, in some embodiments storageservice interface 10 may be configured to support interaction betweenthe storage service and its users according to a web services model. Forexample, in one embodiment, interface 10 may be accessible by clients asa web services endpoint having a Uniform Resource Locator (URL), e.g.,http://storageservice.domain.com, to which web services calls generatedby service clients may be directed for processing. Generally speaking, aweb service may refer to any type of computing service that is madeavailable to a requesting client via a request interface that includesone or more Internet-based application layer data transport protocols,such as a version of the Hypertext Transport Protocol (HTTP) or anothersuitable protocol.

Web services may be implemented in a variety of architectural styles,using a variety of enabling service protocols. For example, in aRepresentational State Transfer (REST)-style web services architecture,the parameters that are pertinent to a web services call (e.g.,specifying the type of service requested, user credentials, user data tobe operated on, etc.) may be specified as parameters to the datatransport command that invokes the web services call to the web servicesendpoint, such as an HTTP GET or PUT command. In some implementations,REST-style web services architectures are stateless, in that each webservices call may contain all the information necessary to process thatcall without reference to external state information. In contrast toREST-style web services architectures, document-based or message-basedweb services architectures may encode the parameters and data pertinentto a web services call as a document that may be transmitted to a webservices endpoint and then decoded and acted upon by the endpoint. Forexample, a version of eXtensible Markup Language (XML) or anothersuitable markup language may be used to format the web services requestdocument. In some embodiments, the markup language used to format therequest document may delimit parameters that control the processing ofthe request, while in other embodiments certain features of the markuplanguage itself (e.g., certain tags) may directly control aspects ofrequest processing. Additionally, in some embodiments, the resultingdocument may be encapsulated within another protocol, such as a versionof the Simple Object Access Protocol (SOAP), for example, in order tofacilitate processing of the web services request by the endpoint.

Other protocols may also be employed within various embodiments of webservices architectures. For example, a version of Web ServicesDescription Language (WSDL) may be employed by a web services endpointto publish its interfacing requirements to potential clients. Webservices endpoints may make themselves known to potential clientsthrough a directory protocol such as a version of the UniversalDescription, Discovery and Integration (UDDI) protocol. Numerous othertypes of protocols relating to the provision of computing services viaweb services interfaces may exist, and any given web servicesimplementation may use any suitable combination of such protocols.

It is contemplated that in some embodiments, interface 10 may supportinterfaces other than web services interfaces, instead of or in additionto a web services interface. For example, an enterprise may implement astorage service for use by clients external to the enterprise, who mayaccess the service via web services protocols, as well as users withinthe enterprise, who may use a different type of interface (e.g., aproprietary interface customized to the enterprise's intranet). In someembodiments, interface 10 may support each of the various types ofinterfacing protocols through which any user of the storage service mayaccess the service. In other embodiments, different instances ofinterface 10 may be provided for each distinct interface approach. It isnoted that in some embodiments, those aspects of interface 10 related tohandling interactions with clients (e.g., receiving and responding toservice requests) may be implemented separately from those aspects thatimplement the general architecture of the storage service (e.g., theorganization of the service into a hierarchy of buckets and objects). Insome such embodiments, the portion of interface 10 relating to clientinteraction (e.g., via web services protocols) may be bypassed bycertain users, such as those internal to an enterprise, as described ingreater detail below in conjunction with the description of FIG. 2.

As shown in FIG. 1, interface 10 provides storage service users withaccess to buckets 20. Generally speaking, a bucket 20 may function asthe root of an object namespace that is associated with a user of thestorage service. For example, a bucket 20 may be analogous to a filesystem directory or folder. In some embodiments, individual buckets 20may also form the basis for accounting for usage of the storage service.For example, a user may be associated with one or more buckets 20 forbilling purposes, and that user may be billed for usage of storageresources (e.g., storage of objects 30) that hierarchically residewithin the namespace established by those buckets 20.

In the illustrated embodiment, each of buckets 20 a-n includesassociated metadata 21 a-n as well as a respective access policy 23 a-n.Generally speaking, metadata 21 may include any suitable metadata thatmay be used to describe aspects or properties of a given bucket 20. Forexample, metadata 21 may include information identifying the date of abucket's creation, the identity of its creator, whether the bucket hasany objects 30 associated with it, or other suitable information. Insome embodiments, metadata 21 may include information indicative ofusage characteristics of a bucket 20, such as the total size of objects30 associated with bucket 20, access history of users with respect tobucket 20 and/or its associated objects 30, billing history associatedwith bucket 20, or any other suitable information related to current orhistorical usage of bucket 20. In one embodiment, each bucket 20 may beassociated with a respective unique identifier, which may be specifiedby a user or automatically assigned by the storage service. The uniqueidentifier may be stored within metadata 21 or as a separate property orfield of bucket 20. It is noted that in some embodiments, a given bucket20 may not include explicit references, pointers or other informationcorresponding to the objects 30 associated with given bucket 20. Rather,as described in greater detail below, location and selection of objects30 may be performed through the use of a separate mapping facilityreferred to herein as a keymap.

An access policy 23 may include any information needed to control accessto objects 30 associated with a bucket 20. Access policy 23 may includeinformation identifying the client or clients allowed to access a bucket20 and its associated objects 30, and in what capacity. For example,access policy 23 may store a user identifier and/or authenticationcredentials (e.g., a password) for one or more clients, and may furtherspecify whether a given client is allowed to modify or only read objects30. Access policy 23 may also implement default or group-orientedpolicies (e.g., by allowing universal read access but limiting writeaccess to objects 30 to a specified client or group of clients) or anyother desired security model.

In the illustrated embodiment, a given bucket 20 may be associated withone or more objects 30, each of which may include respective metadata 31and data 33. Generally speaking, data 33 of an object 30 may correspondto any sequence of bits. The type of data represented by the bits storedwithin an object 30 may be transparent to the storage service. That is,the bits may represent text data, executable program code, audio, videoor image data, or any other type of digital data, and the storageservice may not necessarily distinguish among these various data typesin storing and manipulating objects 30. In some embodiments, the size ofdata 33 may be limited to a fixed ceiling (e.g., 1 gigabyte (GB)), whilein other embodiments, objects 30 may be allowed to scale in size subjectonly to the physical storage resources available to the storage service.

Similar to metadata 21 associated with buckets 21, metadata 31 may beconfigured to store any desired descriptive information about itscorresponding object 30. For example, metadata 31 may includeinformation about the date and/or time the corresponding object 30 wascreated, the size of object 30, the type of data 33 stored by object 30(e.g., a data type defined by the Multipurpose Internet Mail Extensions(MIME) standard), or any other type of descriptive information. In someembodiments, metadata 31 may store usage or history informationindicative of user interactions with corresponding object 30, as well asaccess policy information (e.g., permission information indicating thetypes of access various users may have to the object 30), object costinformation (e.g., billing rate or history associated with the object30), or any other suitable information or combination of types ofinformation attributable to object 30. In some instances, a client mayprovide metadata along with object data to be stored as metadata 31,while in other cases, metadata 31 may include metadata generated by thesystem that manages storage service features (e.g., the storage servicesystem illustrated in FIG. 2 and described below). Some, all or none ofmetadata 31 may be accessible to a client having access rights to anobject 30, depending on the type of metadata, specific provisions of theclient's access rights, or other suitable factors.

In one embodiment, individual objects 30 may be identified within thestorage service system using either of two distinct items ofinformation: a key or a locator. Generally speaking, keys and locatorsmay each include alphanumeric strings or other types of symbols that maybe interpreted within the context of the namespace of the storageservice system as a whole, although keys and locators may be interpretedin different ways. In one embodiment, a key may be specified by a clientat the time a corresponding object 30 is created within a particularbucket 20 (e.g., in response to a request by the client to store a newobject). If no key is specified by the user, a key may be assigned tothe new object 30 by the storage service system. In such an embodiment,each respective key associated with objects 30 of a particular bucket 20may be required to be unique within the namespace of that bucket 20.Generally speaking, a key may persist as a valid identifier throughwhich a client may access a corresponding object 30 as long as thecorresponding object exists within the storage service system.

Within a given bucket 20, keys may be used to generate a hierarchicalobject namespace similar to a file directory or folder namespace commonto the file systems of conventional operating systems. For example, aclient may be granted object reading and writing access rights to aparticular bucket 20 having the unique identifier 050739517. In oneembodiment, the client may then issue web services calls to the addresshttp://storageservice.domain.com/050739517 in order to generate keyswithin the bucket namespace that correspond to objects within thebucket. For example, a client may specify that an object 30 is to becreated within this particular bucket using the key “MyDocuments/Email/message.txt”, such that the object 30 may be accessedusing a web services call to the address:http://storageservice.domain.com/050739517/My Documents/Email/message.txt

It is noted that in some embodiments, hierarchical structure that isimplied by a key may not necessarily be reflected in the underlyinghierarchy of object storage. For example, in one embodiment, objects 30associated with a given bucket 20 may be stored in a flat,non-hierarchical fashion within the storage service system, even thoughthe keys associated with the objects 30 may imply a hierarchy. That is,in such an embodiment, buckets 20 may not hierarchically include otherbuckets 20. However, in other embodiments, hierarchical inclusion ofbuckets 20 within other buckets 20 may be supported, although any suchhierarchy of buckets need not map directly to a hierarchy implied byobject keys.

In one embodiment, a request by a client to access an object 30identified by a key may be subjected to client authenticationprocedures, access control checks, and/or a mapping process (such asdescribed in greater detail below) before the underlying data 33 of therequested object 30 is retrieved or modified. For example, a client maybe requested to provide a password or other credential to prove theclient's identity, and once identified, the access control parametersassociated with the requested bucket 20 may be evaluated to determinewhether the identified client is sufficiently privileged to warrantaccess to the requested key. By contrast, the storage service system maysupport an alternative method of accessing objects 30 by locators ratherthan keys. Generally speaking, a locator may represent a globally uniqueidentifier of an object 30 among all objects 30 known to the storageservice system. That is, while a key may be unique to a namespaceassociated with a particular bucket 20, a locator may be unique within aglobal namespace of all objects 30 within all buckets 20. For example, alocator may include an alphanumeric string generated by the storageservice system to be unique among other locators. As described ingreater detail below, in some embodiments, multiple instances of anobject 30 may be replicated throughout the physical storage devices usedto implement the storage service system, for example to increase dataredundancy and fault tolerance. In such embodiments, a unique locatormay exist for each replicated instance of a given object 30.

It is noted that while in some embodiments, a key may be guaranteed toremain valid for access to an object 30 so long as that object 30 existswithin the storage service system, such a guarantee may or may not applyto any given locator of that object 30. For example, if a replicatedinstance (or replica) of object 30 migrates to a different physicalstorage location (e.g., due to failure or replacement of its underlyingstorage medium), a locator that refers to that specific instance maycease to be valid, although another locator corresponding to themigrated instance of object 30 in its new location may be generated andused. More details on the relationship between keys and locators aregiven below in the discussion regarding the operation of the keymapsystem component.

As an example of key-based versus locator-based object access, theobject 30 referenced by the key given above,http://storageservice.domain.com/050739517/My Documents/Email/message.txt

may have one or more instances stored within the storage service system,one of which may be identified by a locator of the format:http://storageservice.domain.com/locator/3859C89A208FDB5A

In this particular embodiment, it is noted that the key reference toobject 30 is expressed relative to a particular bucket 20, while thelocator reference is expressed as an absolute 128-bit hexadecimal numberwithin the global locator space (although other types of locatorencodings or formats may be employed). In one embodiment, aclient-issued web services request directed to a locator may bypass someor all of the authentication, access rights, translation or other stepsthat may be applied to a key-based web services request. Owing to fewerlayers of processing, in some such embodiments a locator-based requestmay be processed more quickly than a key-based request. However, becausesecurity measures may be bypassed for locator-based requests, clientsmay need to provide their own assurances that locators for sensitiveobjects 30 are not compromised (e.g., using encrypted or other securemeans with which to transmit and receive locators). Further, because thepersistence of locators may not be guaranteed (e.g., in the case ofobject instance migration discussed above), a client choosing to performlocator-based object access may need to tolerate the possibility oflocators becoming invalid during use, for example, by obtaining newlocators on a preemptive basis or in response to discovering that anexisting locator is no longer valid.

Depending on the storage needs of the client and the caveats notedabove, locator-based access may offer improved processing performance(e.g., in latency and throughput of web services request processing)relative to key-based access. For example, a client may elect to uselocator-based access to refer to frequently-accessed objects 30 that arenot particularly sensitive (e.g., reference materials, images or othersuitable types of data). It is noted that in some embodiments,locator-based access may be disabled on the basis of individual objects30, thus forcing clients that wish to access such objects to usekey-based requests and to correspondingly submit to any authenticationand access rights controls associated with such requests. However, evenfor objects 30 for which locator-based access is enabled, a malicious ormalfunctioning client that lacks possession of a valid locator may haveonly a random chance of successfully accessing any given object 30. Sucha chance may be rendered arbitrarily improbable through use of a largelocator namespace, secure techniques for generating locators (e.g., useof secure hashes of object data), or other suitable techniques.

Storage System Architecture and Implementation

One embodiment of a storage service system architecture that may beconfigured to implement a web services-based storage service such asthat illustrated in FIG. 1 is shown in FIG. 2. In the illustratedembodiment, a number of storage clients 50 a-n may be configured tointeract with a web services platform 100 via a network 60. Web servicesplatform 100 may be configured to interface with one or more instancesof a storage service coordinator 120 (or simply, coordinator(s) 120),which in turn may interface with one or more keymap instances 140 andbitstore nodes 160. Additionally, a replicator 180 may also beconfigured to interface with bitstore nodes 160 as well as a replicatorkeymap instance 190. Both coordinator(s) 120 and replicator 180 mayinterface with a nodepicker service 130. In the illustrated embodiment,each instance of nodepicker 130, keymap 140, bitstore nodes 160 and thereplicator keymap 190 may be associated with a respective instance of adiscovery and failure detection daemon (DFDD) 110. It is noted thatwhere one or more instances of a given component may exist, reference tothat component hereinbelow may be made in either the singular or theplural. However, usage of either form is not intended to preclude theother.

In various embodiments, the components illustrated in FIG. 2 may beimplemented directly within computer hardware, as instructions directlyor indirectly executable by computer hardware (e.g., a microprocessor orcomputer system), or a combination of these techniques. For example, thecomponents of FIG. 2 may be implemented by a distributed systemincluding a number of computing nodes (or simply, nodes), such as thecomputer system embodiment shown in FIG. 29 and discussed below. Invarious embodiments, the functionality of a given storage service systemcomponent may be implemented by a particular node or distributed acrossseveral nodes. In some embodiments, a given node may implement thefunctionality of more than one storage service system component.Following an overview of the general functionality of the components ofFIG. 2 and an exemplary physical deployment of the storage servicesystem as shown in FIG. 3, details of certain embodiments of particularstorage system components are provided below in conjunction with thedescriptions of FIGS. 4-28.

Generally speaking, storage clients 50 may encompass any type of clientconfigurable to submit web services requests to web services platform100 via network 60. For example, a given storage client 50 may include asuitable version of a web browser, or a plugin module or other type ofcode module configured to execute as an extension to or within anexecution environment provided by a web browser. Alternatively, astorage client 50 may encompass an application such as a databaseapplication, media application, office application or any otherapplication that may make use of persistent storage resources. In someembodiments, such an application may include sufficient protocol support(e.g., for a suitable version of Hypertext Transfer Protocol (HTTP)) forgenerating and processing web services requests without necessarilyimplementing full browser support for all types of web-based data. Thatis, storage client 50 may be an application configured to interactdirectly with web services platform 100. As described below, storageclient 50 may be configured to generate web services requests accordingto a Representational State Transfer (REST)-style web servicesarchitecture, a document- or message-based web services architecture, oranother suitable web services architecture.

In other embodiments, storage client 50 may be configured to provideaccess to web services-based storage to other applications in a mannerthat is transparent to those applications. For example, storage client50 may be configured to integrate with an operating system or filesystem to provide storage in accordance with a suitable variant of thestorage model described above. However, the operating system or filesystem may present a different storage interface to applications, suchas a conventional file system hierarchy of files, directories and/orfolders. In such an embodiment, applications may not need to be modifiedto make use of the storage system service model of FIG. 1. Instead, thedetails of interfacing to web services platform 100 may be coordinatedby storage client 50 and the operating system or file system on behalfof applications executing within the operating system environment.

Storage clients 50 may convey web services requests to and receiveresponses from web services platform 100 via network 60. In variousembodiments, network 60 may encompass any suitable combination ofnetworking hardware and protocols necessary to establish web-basedcommunications between clients 50 and platform 100. For example, network60 may generally encompass the various telecommunications networks andservice providers that collectively implement the Internet. Network 60may also include private networks such as local area networks (LANs) orwide area networks (WANs) as well as public or private wirelessnetworks. For example, both a given client 50 and web services platform100 may be respectively provisioned within enterprises having their owninternal networks. In such an embodiment, network 60 may include thehardware (e.g., modems, routers, switches, load balancers, proxyservers, etc.) and software (e.g., protocol stacks, accounting software,firewall/security software, etc.) necessary to establish a networkinglink between given client 50 and the Internet as well as between theInternet and web services platform 100. It is noted that in someembodiments, storage clients 50 may communicate with web servicesplatform 100 using a private network rather than the public Internet.For example, clients 50 may be provisioned within the same enterprise asthe storage service system. In such a case, clients 50 may communicatewith platform 100 entirely through a private network 60 (e.g., a LAN orWAN that may use Internet-based communication protocols but which is notpublicly accessible).

Generally speaking, web services platform 100 may be configured toimplement one or more service endpoints configured to receive andprocess web services requests, such as requests to access objects 30stored by a storage service system. For example, web services platform100 may include hardware and/or software configured to implement theendpoint http://storageservice.domain.com used in previous examples,such that an HTTP-based web services request directed to that endpointis properly received and processed. In one embodiment, web servicesplatform 100 may be implemented as a server system configured to receiveweb services requests from clients 50 and to forward them tocoordinator(s) 120 or to other components of the storage service systemfor processing. In other embodiments, web services platform 100 may beconfigured as a number of distinct systems (e.g., in a cluster topology)implementing load balancing and other request management featuresconfigured to dynamically manage large-scale web services requestprocessing loads.

In various embodiments, web services platform 100 may be configured tosupport REST-style or document-based (e.g., SOAP-based) types of webservices requests as described in detail above. In one particularembodiment, platform 100 may be configured to implement a particular webservices application programming interface (API) that supports a varietyof operations on entities managed by the storage service system. Forexample, the API implemented by platform 100 may support basic clientoperations on buckets or objects, including listing of buckets 20 orobjects 30 (optionally filtered according to a filter pattern orcriterion), retrieval of data or metadata of buckets 20 or objects 30,and creation or deletion of buckets 20 or objects 30. In someembodiments, the API may support more sophisticated client operationssuch as batch application of operations to multiple buckets 20 orobjects 30.

In addition to functioning as an addressable endpoint for clients' webservices requests, in some embodiments web services platform 100 mayimplement various client management features. For example, platform 100may coordinate the metering and accounting of client usage of webservices, including storage resources, such as by tracking theidentities of requesting clients 50, the number and/or frequency ofclient requests, the size of objects 30 stored or retrieved on behalf ofclients 50, overall storage bandwidth used by clients 50, class ofstorage requested by clients 50, or any other measurable client usageparameter. Platform 100 may also implement financial accounting andbilling systems, or may maintain a database of usage data that may bequeried and processed by external systems for reporting and billing ofclient usage activity.

In certain embodiments, platform 100 may be configured to collect and/ormonitor a variety of storage service system operational metrics, such asmetrics reflecting the rates and types of requests received from clients50, bandwidth utilized by such requests, system processing latency forsuch requests, system component utilization (e.g., network bandwidthand/or storage utilization within the storage service system), rates andtypes of errors resulting from requests, characteristics of requestedobjects 30 (e.g., size, data type, etc.), or any other suitable metrics.In such embodiments, platform 100 may be configured to collect suchmetrics in the aggregate, for example as averages over time, or asspecific data points that may be subjected to a variety of analyses. Invarious embodiments, such metrics may be employed to test or monitorsystem performance in ways that may or may not be visible to clients 50.For example, in one embodiment such metrics may be used by systemadministrators to tune and maintain system components, while in otherembodiments such metrics (or relevant portions of such metrics) may beexposed to clients 50 to enable such clients to monitor their usage ofthe storage service system.

In some embodiments, platform 100 may also implement user authenticationand access control procedures. For example, for a given web servicesrequest to access a particular object 30 associated with a given bucket20, platform 100 may be configured to ascertain whether the client 50associated with the request is authorized to access given bucket 20 andparticular object 30. Platform 100 may determine such authorization by,for example, evaluating an identity, password or other credentialagainst credentials associated with given bucket 20, and evaluating therequested access to particular object 30 against an access control listspecifying allowable operations to particular object 30. If a client 50does not have sufficient credentials to access a bucket 20 or to performa requested operation on an object 30 (e.g., the client 50 attempts towrite an object 30 while having only read access privileges), platform100 may reject the corresponding web services request, for example byreturning a response to the requesting client 50 indicating an errorcondition. It is contemplated that in some embodiments, each bucket 20and object 30 may have an associated access control policy governingaccess to that bucket or object. Such an access control policy may bestored as records or lists of access control information within metadata21 or 31, or as a data structure distinct from metadata 21 and 31.

While in some embodiments, a storage service system such as the systemof FIG. 2 may support objects 30 of arbitrary sizes, in otherembodiments objects 30 may be constrained to a certain maximum size,also referred to as a chunk size. In some such embodiments, when aclient provides data to be stored in association with a key and the dataexceeds the chunk size, platform 100 may be configured to divide thedata into two or more chunks according to the chunk size. In oneembodiment, platform 100 may be configured to generate each chunk as arespective object 30 having an associated key value. Platform 100 maygenerate the key values for each chunk as a function of theclient-supplied key in such a way that the original client data can bereconstructed from the chunks when a request for access referencing theclient-supplied key is performed. For example, platform 100 may beconfigured to generate N chunks from client data, and may generate Ncorresponding keys for these chunks by appending N distinct patterns tothe client-supplied key, where the N distinct patterns arelexicographically ordered in the same order in which the N chunks weregenerated. Each of the N chunks may then be managed as a distinct object30 using the techniques described below, and the original data may beregenerated by listing all of the objects 30 having key values for whichthe client-supplied key is a prefix and retrieving those objects in thelisted order. In some embodiments, individual chunks may be accessed,modified or removed without disturbing other chunks, which may improvesystem performance relative to managing data as a single, large object30. It is contemplated that in some embodiments, a client 50 may bepermitted to specify whether a data object it provides should be splitinto chunks or not.

As is the case with many of the storage service system components shownin FIG. 2, segregating the functionality of web services platform 100from other components may improve maintenance and overall scalability ofthe storage service system. For example, additional hardware andsoftware resources may be specifically provisioned for managingadditional web services processing load independently of resourcesallocated to other tasks. Further, the effects of any resource failuresassociated with platform 100 may be confined to that particularfunctional area, thus facilitating the isolation and resolution offailures. However, in some embodiments, it is contemplated that thefunctionality of platform 100 may be integrated into other components.For example, coordinator(s) 120 may be configured to include the tasksassociated with platform 100.

It is also noted that while web services platform 100 may represent theprimary interface through which clients 50 may access the features ofthe storage service system, it need not represent the sole interface tosuch features. For example, in some embodiments coordinator(s) 120 maybe configured to support an alternate API that may be distinct from aweb services interface. Such an alternate API may be used, for example,to allow clients internal to the enterprise providing the storageservice system to bypass web services platform 100. In some cases, theaccounting and/or credentialing services of platform 100 may beunnecessary for internal clients such as administrative clients.

Coordinators 120 may be configured to coordinate activity between webservices platform 100 and other components of the storage servicesystem. In one embodiment, the primary responsibilities of coordinators120 may include conducting read and write activity of object data 33 andmetadata 31 for objects 30 in response to web services requests directedto those objects 30. For example, as described in greater detail below,object read access may involve performing an access to a keymap instance140 to retrieve locators that indicate the bitstore nodes 160 wherereplicas of a given object 30 are stored, followed by performing anaccess to a particular bitstore node 160 in order to read the requesteddata. Similarly, object creation or modification may involve storing anumber of replicas of objects 30 to various bitstore nodes 160 andupdating keymap instance 140, if necessary, to reflect the locators ofthe created or modified replicas. In some embodiments, coordinators 120may be configured to perform these read and write operations to keymapinstances 140 and bitstore nodes 160. However, it is noted that incertain embodiments, coordinators 120 may not operate to create the fullnumber of desired replicas of an object 30 at the time of its creationor modification. As described in greater detail below, in someembodiments a write operation to an object 30 may be considered completewhen coordinators 120 have completed writing a certain number ofreplicas of that object 30 (e.g., two replicas). Further replication ofthat object 30 may be completed as an out-of-band or asynchronousoperation by replicator 180. That is, in such embodiments, the in-bandor synchronous portion of the object creation or modification operationmay include the generation of fewer than the total desired number ofreplicas of the affected object 30. It is noted that while coordinator120 is illustrated as a distinct component from keymap instances 140,bitstore nodes 160, and other system components, it is possible in someembodiments for an instance of coordinator 120 to be implementedtogether with another system component (e.g., as software componentsexecutable by a single computer system). Thus, although the descriptionherein may refer to coordinator 120 storing or retrieving data to orfrom a bitstore node 160, a keymap instance 140, or another component,it is understood that in some embodiments such processing may occurwithin shared computing system resources.

As described above with respect to FIG. 1, in some embodiments thestorage service system may include a bucket-based storage model in whichkeys for various objects 30 may be grouped into buckets 20 foradministrative (e.g., accounting, billing), security or other purposes.In one embodiment, coordinators 120 may be configured to process variousbucket-related operations in response to corresponding web servicesrequests from clients 50. For example, coordinators 120 may beconfigured to perform some or all of the following bucket operations:

-   -   Create bucket: Generate and store a new bucket name for a bucket        20.    -   Delete nonempty bucket: Delete a given bucket 20 including        associated metadata 21 and all keys associated with objects 30        within given bucket 20.    -   Delete empty bucket: Delete given bucket 20 and associated        metadata 21 only if no keys of objects 30 are associated with        given bucket 20, otherwise return an error condition.    -   Write bucket data: Write data (e.g., metadata 21) to an existing        bucket 20.    -   List bucket keys: List keys of objects 30 associated with a        given bucket 20 (optionally sorted or filtered according to a        pattern, regular expression, wildcards, etc.).    -   List buckets: List buckets 20 associated with a given subscriber        (e.g., a user or client 50).        In some embodiments, coordinators 120 may be configured to        generate identifiers for newly created buckets 20 using a        suitable random number algorithm with a low probability of        generating collisions. In other embodiments, coordinators 120        may be configured to support client-specified bucket        identifiers, for example by checking requested identifiers for        uniqueness with respect to existing bucket identifiers upon a        client request for bucket creation.

As mentioned above, instances of objects 30 may be replicated acrossdifferent bitstore nodes 160, for example to increase the likelihoodthat object data will survive the failure of any given node 160 or itsrelated infrastructure. Object replication within the storage servicesystem presents several opportunities for management and optimizationthat may be addressed in the illustrated embodiment by nodepicker 130and replicator 180, as follows.

When coordinator 120 receives a request to write an object 30, it maycorrespondingly write object 30 to a given number of nodes 160 beforedeclaring the write to be complete. However, the number and particularselection of nodes 160 to which object 30 should be written may varydepending on a number of different storage policy considerations. Forexample, requiring that a certain minimum number of replicas (e.g., twoor three) of object 30 have been successfully written before the writeoperation is considered to be completed may be prudent in order for thewritten data to be durable in view of possible failures. However, it mayalso be desirable to ensure that the nodes 160 chosen to store theminimum number of replicas are distributed among different possible lociof failure, or areas. For example, nodes 160 that are located in thesame data center may be more likely to fail concurrently (e.g., due to acatastrophic failure such as a natural disaster, power failure, etc.)than nodes 160 that are geographically separated.

Nodepicker 130, which may be referred to generically as storage nodeselection logic, may be configured as a service accessible bycoordinator 120 and replicator 180 that, in one embodiment, mayimplement algorithms for selecting nodes 160 for object read and writeoperations such that various storage policies are satisfied. Forexample, in the case of writing an object 30 as outlined above,nodepicker 130 may operate to develop a write plan, or a particularsequence of nodes 160 to which the object 30 should be written. Indeveloping a particular write plan, nodepicker 130 may be configured toensure that the write plan has a reasonable chance of succeeding—forexample, that the nodes 160 specified in the write plan are in factoperational and are expected to have sufficient storage resourcesavailable to accept the object 30—and that the write plan, if completed,would satisfy all storage policies pertinent to write operations.Example write storage policies may include the following:

-   -   Durability policy: If the write plan successfully completes,        instances of object 30 will be stored on at least N different        nodes 160.    -   Area diversity policy: If possible, the write plan will include        nodes 160 distributed among at least M different areas.    -   Locality policy: If possible, the write plan will give        preference (e.g., in number) to nodes 160 in an area local to        the requesting coordinator 120.    -   Load balancing policy: Attempt to equalize write request traffic        among nodes 160 (e.g., to avoid “hot nodes”).    -   Space balancing policy: Attempt to equalize the storage resource        capacity utilization among nodes 160.    -   Lowest-cost chain policy: Attempt to minimize the total cost        (e.g., network latency) of the sequence of node write operations        in the write plan.

It is noted that in various embodiments, nodepicker 130 may beconfigured to take some or all of these policies, or other policies notlisted, into account when formulating a given write plan. Further,different policies may be weighted with different priorities. Forexample, in one embodiment the durability policy may be a mandatorypolicy that all write plans must satisfy, while the remaining policiesmay be satisfied on a best-effort basis. In some cases, some storagepolicies may conflict with others. For example, the area diversityproperty, which favors wide distribution of object instances amongdifferent areas, is generally contrary to the locality policy, whichfavors localizing object instances within a particular area. If thenumber of object instances is sufficiently large, it may be possible tosatisfy both policies. For example, if five instances of an object 30are to be created, it may be possible to store two instances to twodistinct areas and three instances within a third distinct area local tothe requesting coordinator 120, thus satisfying both the locality andarea diversity policies. If it is not possible to satisfy all policiesspecified for a write plan, nodepicker 130 may attempt to prioritizethose policies that will be satisfied and create a best-effort writeplan, or may return an error indication to the requesting coordinator120 indicating that the object write cannot be satisfactorily performed.

In some embodiments, nodepicker 130 may also assist coordinators 120 inreading objects 30. For example, an object read operation may berequested by a coordinator 120 other than the coordinator thatoriginally or most recently wrote the requested object 30. Thus,instances of object 30 that may have been stored locally with respect tothe writing coordinator 120 may not be local with respect to the readingcoordinator 120. Nodepicker 130 may be configured to identify the node160 that may offer the best read performance available to the readingcoordinator 120. For example, nodepicker 130 may identify a node 160that is closest to the reading coordinator 120 (e.g., in terms ofgeographic distance or network topology) or a node 160 that offers thehighest read bandwidth (e.g., the least loaded node 160 or the node 160having a higher-performance class of storage hardware), or nodepicker130 may use other performance criteria for selecting a node 160 fromwhich to read object 30. In other embodiments, rather than optimize theperformance of the read operation with respect to the readingcoordinator 120, nodepicker 130 may globally plan concurrent readoperations so as to optimize the performance of the system as a whole(e.g., to maximize global read throughput).

To develop write plans and to advise coordinators 120 with respect toobject read operations, nodepicker 130 may be configured to monitor thestate of nodes 160, e.g., with respect to their operational status andavailable resources. In one embodiment, nodepicker 130 may be configuredto interact with an instance of DFDD 110 (described below) in order toidentify the nodes 160 within the storage service system that arecurrently operational. Once nodepicker 130 is aware of the operationalnodes 160, it may query those nodes to ascertain the resources (e.g.,storage capacity) available at each one. Because the operational andresource states of nodes 160 may change over time, in some embodimentsnodepicker 130 may occasionally refresh operational state informationvia DFDD 110 and poll the resultant nodes 160 to refresh their resourcestate information. It is noted that in some instances, nodepicker 130may not have a perfectly synchronous view of the state of nodes 160. Forexample, a particular node 160 believed to be available by nodepicker130 may in fact have failed since the last update of state information.In such instances, nodepicker 130 may be unable to guarantee that itsread or write plans may be able to be completed by a coordinator 120. Ifa coordinator 120 cannot access a node 160 that is specified bynodepicker 130, the related operation may fail and be reattempted by thecoordinator 120 in its entirety, or the coordinator 120 may negotiatewith nodepicker 130 to revise the requested plan. In some cases, if thefailure of a node 160 specified in a write plan impacts only optional orbest-effort storage policies while still allowing mandatory storagepolicies to be satisfied, the write plan may be allowed to complete. Insome such embodiments, replicator 180 may be configured to attempt tosatisfy the unsatisfied storage policies at a later time, as describedbelow.

In some embodiments, multiple instances of nodepicker 130 may bedeployed throughout the storage service system. For example, arespective instance of nodepicker 130 may be deployed for each instanceof coordinator 120. While nodepicker 130 may be deployed as a servicethat may be accessed from coordinators 120 (and replicator 180) via anAPI, this configuration is not essential. In other embodiments, thefunctionality of nodepicker 130 may be incorporated directly withininstances of coordinator 120 and/or replicator 180.

As mentioned above, the reliability and availability of object data maybe increased by replicating objects 30 throughout the storage servicesystem. For example, distributing instances or replicas of objects 30within a geographically-dispersed system may improve the performance ofsimilarly-dispersed clients 50 that attempt to access such objects 30 bypossibly locating some object instances closer to such clients. (It isnoted that in the context of object replication, the terms “instance”and “replica” may be used interchangeably herein.) Further, objectreplication may generally decrease the chances of data loss resultingfrom destruction of a particular object instance. However, it may be thecase in some embodiments that at a given point in time, the number ofvalid replicas of an object 30 may be less than a desired or targetnumber of replicas. For example, a replication storage policy to beenforced across the storage service system may specify that a particulartarget number of replicas of each object 30 (e.g., 3 or any othersuitable number) should exist at any given time. However, for a givenobject 30, the actual number of valid replicas might be less than thetarget number, for a variety of reasons. For example, a previously validreplica may become inaccessible due to a failure of the device on whichit was stored. Alternatively, in some embodiments the number ofinstances of an object 30 that are written by a coordinator 120 may beless than the target number of replicas for that object 30. For example,as described above, the instances may be written according to a writeplan specified by nodepicker 130, which may take into account adurability policy that requires fewer instances than the target number.

In one embodiment, replicator 180 may operate to examine objects 30 todetermine whether the number of valid replicas of each object 30satisfies a target number (e.g., whether the number of replicas is atleast the target number at the time the determination is made).Specifically, in one embodiment, replicator 180 may be configured tocontinuously iterate over records specifying the number and location ofinstances of each object 30. For example, replicator 180 may referencethe replicator keymap 190, which, like keymap instances 140 described ingreater detail below, may be configured to store mappings between objectkeys and corresponding locators identifying replicated object instances.(In other embodiments, replicator 180 may consult one of keymapinstances 140 rather than a dedicated instance of the keymap.) In someembodiments, it is contemplated that multiple instances of replicator180 may be configured to concurrently examine different portions of thekeymap space, which may reduce the overall amount of time required toexamine the status of all objects 30 managed by the storage servicesystem.

If replicator 180 determines that the target number of valid replicas isnot satisfied for a given object 30, it may be configured to writeadditional replicas of the given object 30, in a manner similar tocoordinator 120 performing a write operation to the given object 30. Forexample, replicator 180 may interface with nodepicker 130 to obtain awrite plan for creating additional replicas, as described above.Alternatively, replicator 180 may implement its own algorithmsreflecting policies for generating object replicas. In some embodiments,replicator 180 may accord different priorities to creating replicas forobjects 30 depending upon the condition under which additional replicasare required. For example, an object 30 that has fewer than the targetnumber of locators listed in the replicator keymap 190 may have beenrecently written by coordinator 120. By contrast, an object 30 that hasthe target number of locators of which some are invalid may haveexhibited a failure of underlying storage. As a matter of policy,replicator 180 may attempt to correct the former case before the latter,or vice versa. Alternatively, replicator 180 may attempt to generateadditional replicas for any object 30 having fewer than the targetnumber of valid replicas whenever this condition is encountered,regardless of the particular circumstances giving rise to the condition.

As mentioned above, the overall reliability of storage of an object 30may be increased by storing replicas of object data, for example withindifferent areas or data centers. However, it is noted that in someembodiments, each replica need not correspond to an exact copy of theobject data. In one embodiment, an object 30 may be divided into anumber of portions or “shards” according to a redundant encoding scheme(such as a parity, error correction code or other scheme), such that theobject data may be recreated from fewer than all of the generatedportions. For example, using various schemes to generate N portions froman object 30, the object data may be recreated from any N−1 of theportions, any simple majority of the N portions, or other combinationsof portions according to the encoding scheme. In such an embodiment, thereplicas of object 30 may correspond to the generated portions, orcertain combinations of the portions. Such an approach may provideeffective fault tolerance while reducing data storage requirements incomparison to storing multiple complete copies of the object data.However, it is noted that in some embodiments, redundant encodingtechniques may also be used in combination with complete replication ofobject data. For example, multiple individual complete copies of objectdata may be stored among nodes 160 as respective collections of multipleportion determined according to a suitable redundant encoding techniqueas mentioned above. Finally, it is noted that in some embodiments,certain objects 30 need not be stored with any degree of replication orfault tolerance at all. For example, as described below in conjunctionwith the description of storage classes, a client may request that anobject 30 be stored according to a storage class that specifies littleor no degree of fault tolerance, possibly at lower cost than for astorage class specifying a higher degree of fault tolerance.

Generally speaking, keymap instances 140 may provide records of therelationships between keys of objects 30 and locators of particularinstances or replicas of objects 30. In storing such records, keymapinstances 140 also reflect the degree to which objects 30 are replicatedwithin the storage system (e.g., how many instances of an object 30exist, and how they may be referenced). Bitstore nodes 160 may generallyprovide storage for individual instances of objects 30 as identified bylocators. However, a given node 160 may be unaware of the state of aninstance with respect to any other nodes 160, or of the relationshipbetween an instance's locator and the key of its corresponding object30. That is, generally speaking, the state information maintained bykeymap instances 140 may be transparent to bitstore nodes 160. DFDD 110may operate to detect and communicate state information regarding theoperational status of nodes 160 and/or keymap instances 140 (andreplicator keymap 190, if implemented), such that clients of DFDD 110such as coordinators 120 and replicator 180 may obtain an accurate,though possibly delayed view of the detected status. These componentsare addressed in greater detail below.

One embodiment illustrating a physical deployment of certain componentsof the storage service system architecture of FIG. 2 is shown in FIG. 3.In the illustrated embodiment, a data center 300 is shown including twoareas 310 a-b. Additionally, areas 310 c-d are shown externally to datacenter 300, and areas 310 a-d are interconnected via network 60. Each ofareas 310 a-d includes a respective coordinator instance 120 a-d. Areas310 a-d may also include various combinations of bitstore nodes 160 andkeymap instances 140, as well as other components of FIG. 2 not shown inFIG. 3. For example, area 310 a includes four bitstore nodes 160, area310 b includes three bitstore nodes 160 and a keymap instance 140, area310 c includes two bitstore nodes 160, and area 310 d includes onebitstore node 160 and one keymap instance 140.

As mentioned above, in one embodiment each of areas 310 a-d may beconsidered a locus of independent or weakly correlated failure. That is,the probability of any given area 310 experiencing a failure may begenerally independent from or uncorrelated with the probability offailure of any other given area 310, or the correlation of failureprobability may be less than a threshold amount. For example, two areas310 may exhibit less than a 10% chance of failing concurrently. Failurecorrelation or independence may be measured using any suitablestatistical or probabilistic technique and implemented in a variety ofways. For example, areas 310 may be physically separated or connected toindependent utility grids, rendering it likely that a catastrophe thataffects one area 310 will not affect the other. Similarly, within datacenter 300, distinct areas 310 may have independent backup powersupplies, network connections or other redundant resources that mayfunction to enable one area 310 to continue operating despite a failureof another area 310.

It is noted that in some embodiments, two areas 310 that have small butnonzero correlation between their respective likelihoods of failure maystill be referred to as having independent likelihoods of failure. Forexample, despite each having robust and independent systems for backuppower, cooling, etc., two areas 310 within a given data center 300 maybe susceptible to concurrent failure in the event of a catastrophe ofsufficient magnitude (e.g., an explosion sufficient to destroy theentire data center 300). However, the probability of an event sufficientto cause these two areas 310 to fail concurrently may be small enoughthat, for practical purposes, the two areas 310 may be said to haveindependent likelihoods of failure.

Areas 310 may include additional levels of hierarchy (not shown). Forexample, in one embodiment areas 310 may be subdivided into racks, whichmay be further subdivided into individual nodes, such as bitstore nodes160, although any suitable area organization may be employed. Generallyspeaking, areas 310 may include computing resources sufficient toimplement the storage service system components deployed within thearea. For example, each bitstore node 160 may be implemented as anautonomous computer system that may include a variety of hardware andsoftware components as described below in conjunction with thedescriptions of FIGS. 4-9. Similarly, each keymap instance 140 may beimplemented via a number of computer systems configured as describedbelow in conjunction with the descriptions of FIGS. 10-22.

In some embodiments, components such as web services platform 100,coordinators 120, nodepicker 130, replicator 180, and DFDD 110 may beimplemented via discrete computing resources within each area 310 inwhich the components are deployed. For example, each of these componentsmay be implemented as a set of instructions and data executable by arespective computer system. Alternatively, some or all of thesecomponents may be implemented as processes that may execute concurrentlyon one or more computer systems. In some embodiments, computingresources used to implement some or all of these components may beshared with those resources used to implement bitstore nodes 160 orkeymap instances 140. For example, a computer system may be configuredto implement both some portion of keymap 140 functionality as well ascoordinator 120 functionality. Generally speaking, any suitablepartitioning of the components of FIG. 2 across computing resourcesdeployed within individual areas 310 may be employed. It is noted that,as shown in FIG. 3, different areas 310 may include differentcombinations of storage service system components, and the embodimentshown is intended to be illustrative rather than limiting.

Additionally, different storage service system components maycommunicate according to any suitable type of communication protocol.For example, where certain components of FIG. 2 are implemented asdiscrete applications or executable processes, they may communicate withone another using standard interprocess communication techniques thatmay be provided by an operating system or platform (e.g., remoteprocedure calls, queues, mailboxes, sockets, etc.), or by using standardor proprietary platform-independent communication protocols. Suchprotocols may include stateful or stateless protocols that may supportarbitrary levels of handshaking/acknowledgement, error detection andcorrection, or other communication features as may be required ordesired for the communicating components. For example, in one storageservice system embodiment, a substantial degree of inter-componentcommunication may be implemented using a suitable Internet transportlayer protocol, such as a version of Transmission Control Protocol(TCP), User Datagram Protocol (UDP) or a similar standard or proprietarytransport protocol. However, it is also contemplated that communicationsamong storage service system components may be implemented usingprotocols at higher layers of protocol abstraction. For example, likecommunications between clients 50 and web services interface 100,communications between storage service system components may beconducted using application layer protocols such as web services callsover HTTP, for example.

Bitstore Configuration

As discussed above, in the storage service system architectureembodiment shown in FIG. 2, bitstore nodes 160 may generally operate toprovide storage for the various objects 30 managed by the storageservice system. One exemplary embodiment of a bitstore node 160 is shownin FIG. 4. In the illustrated embodiment, bitstore node 160 includes astorage node management (SNM) controller 161 configured to interfacewith a storage repacker 163 and a logical file input/output (I/O)manager 165. Manager 165 is configured to interface with a file system167, which is in turn configured to manage one or more storage devices169. In various embodiments, any of SNM controller 161, storage repacker163, logical file I/O manager 165 or file system 167 may be implementedas instructions that may be stored on a computer-accessible medium andexecutable by a computer to perform the functions described below.Alternatively, any of these components may be implemented by dedicatedhardware circuits or devices.

In one embodiment, SNM controller 161 may be configured to provide anobject storage API to a client of node 160 as well as to coordinate theactivities of other components of node 160 to fulfill actions accordingto the API. For example, a controller 120 may be configured to store andretrieve objects 30 to and from a given node 160 via the API presentedby SNM controller 161. While API management is described herein as afeature of SNM controller 161, it is contemplated that in someembodiments, the API processing functions of node 160 may be implementedin a module or component distinct from SNM controller 161.

The object storage API may support object put, get and releaseoperations. In one such embodiment, an object put operation, which mayalso be generically referred to as a store operation or a writeoperation, may specify the data and/or metadata of an object 30 as anargument or parameter of the operation. Upon completion on a given node160, a put operation may return to the requesting client a locatorcorresponding to the stored object 30, which may uniquely identify theobject instance on the given node 160 relative to all other objects 30stored throughout the storage service system, as described in greaterdetail below.

Conversely, an object get operation, which may also be genericallyreferred to as a read or retrieval operation, may specify a locator ofan object 30 as a parameter. Upon completion, a get operation may returnto the requesting client the object data and/or metadata correspondingto the specified locator. In some embodiments, the get operation maysupport a parameter that allows a requesting client to specify whetherobject data, metadata or both are to be returned to the client.

Like a get operation, an object release operation, which may also begenerically referred to as a delete or remove operation, may specify alocator of an object 30 as a parameter. However, upon completion, arelease operation may release storage resources previously associatedwith the referenced object 30, and such resources may then be used tostore other objects 30. In one embodiment, once a locator is released,subsequent get operations to the locator may or may not succeed for aperiod of time. That is, a release operation may serve as a signal tonode 160 that it may release storage resources for reuse, but node 160may not attempt to do so immediately or to notify or otherwisesynchronize such reuse with a client. Thus, continued attempts by aclient to access an object 30 following its release may succeed forarbitrary periods of time, following which the object 30 may becomeinaccessible without notice. In other embodiments, node 160 may beconfigured to prevent client access to a locator that was previouslyreleased, regardless of whether the object data is still available.

It is contemplated that in various embodiments, put, get and releaseoperations may employ other parameters and/or return various status,error or other indications according to any suitable protocol. Forexample, a put operation may return an error condition if there areinsufficient resources on node 160 for the requested object 30 to bestored, or if the put cannot be completed for some other reason. It isalso contemplated that in some embodiments, the object storage API ofnode 160 may include other operations. For example, the API may beconfigured to facilitate the creation of object replicas by supporting areplicate operation. In one embodiment, a replicate operation mayoperate similarly to a put operation, except that instead of supplyingthe data of the object 30 to be stored to a target node 160, arequesting client may specify a locator of that object 30 on a differentnode 160. The target node 160 may then interact with the specified node160 to obtain the object data and/or metadata and may return to theclient a locator of the object relative to the target node. In otherembodiments, node 160 may support other suitable operations on objects30.

It is noted that in some embodiments implementing put, get and releaseoperations as described above, existing objects 30 may not be modifiedin place. Rather, an instance of an object 30 may be effectivelymodified by releasing the existing instance after writing a new instancethat includes the modified data. Such an approach may simplifyimplementation of the underlying management layers of node 160, forexample by reducing fragmentation or object relocation that may occur ifa modification to an object 30 renders it smaller or larger than itsoriginal size. As described in greater detail below with respect to webservices platform 100, in some embodiments the storage service systemmay support splitting of large objects into chunks, each of which may bemanaged as a distinct object 30. This approach may improve theperformance of node 160 in processing large objects that may befrequently modified by limiting the scope of the chunks that may need tobe rewritten. However, it is contemplated that in other embodiments,node 160 may include those features necessary to support modification ofobjects 30 in place rather than through the release-rewrite approachjust described.

In the illustrated embodiment, logical file I/O manager 165 (or, simply,manager 165) may be configured to virtualize underlying device or filesystem characteristics in order to present to SNM controller 161 andrepacker 163 one or more logically contiguous storage spaces in whichobjects 30 may reside. For example, a given object 30 may be locatedwithin a logical storage space according to its offset within thestorage space and its extent from that offset (e.g., in terms of theobject size, including data and metadata). By providing such a logicalstorage space, manager 165 may present a uniform view of underlyingstorage to SNM controller 161 regardless of the implementation detailsof such underlying storage.

To facilitate access to objects 30 within the logical storage space, inone embodiment manager 165 may be configured to assign an object indexvalue (also referred to as an object index) to each object 30 stored toa node 160. Generally speaking, the index of any given object 30 may beunique within a particular node 160. For example, in one embodiment theobject index may be obtained by incrementing a counter whenever anobject 30 is stored to a node 160, and using the resulting counter valueas the object index. (In embodiments where multiple object writeoperations are allowed to proceed concurrently, the counter incrementmay be synchronized, e.g., through serialization, to ensure that objectindex values are assigned in a consistent and predictable fashion.) Asufficiently large counter value, such as a 64-bit unsigned integer, forexample, may ensure that for practical purposes every object 30 isassigned a unique index value. Such a counter may roll over after, say,2⁶⁴ objects have been stored, after which previously-generated indexvalues may repeat. However, collisions are extremely unlikely, as it ishighly improbable that the object 30 that was previously assigned agiven index value will still exist within node 160 after the counterrolls over. It is noted that any other suitable method for assigning anobject index may also be employed. As described below, object indexvalues may be used in combination with a unique identifier of a node 160to determine a locator value that may be used by coordinator 120 orother clients of node 160 to reference a particular object 30.

Manager 165 may be configured to use the unique object index valuesdescribed above to organize information about where objects 30 arelocated within the logical storage space in ways that facilitate objectaccess. For example, as shown in the upper portion of FIG. 5, in oneembodiment manager 165 may be configured to store a table or similardata structure that may be organized for ready access via object indexvalues. In the illustrated embodiment, index table 500 may include anumber of entries 510, each of which may include a number of fieldsincluding an object index field, an offset field, an object size field,a metadata size field, and a cyclic redundancy check (CRC) field. Asshown in the lower portion of FIG. 5 for several exemplary objects 30,the offset field of an entry 510 may specify the location of thebeginning of the corresponding object 30 within the logical storagespace, and the object size and metadata size fields may specify thedegree to which the object data and metadata extend from the offsetpoint. In the illustrated embodiment, object data precedes objectmetadata, although this order may be reversed in other embodiments. TheCRC field may store the result of a cyclic redundancy check algorithm orother suitable type of checksum or hash algorithm. The value initiallystored into the CRC field may be computed when an object 30 is initiallystored to node 160. Subsequently, when the object 30 is accessed, thesame algorithm may be applied to the object data and or metadata and theresultant value compared against the stored CRC field value. If thecomparison results in a mismatch, the integrity of the stored data mayhave been compromised. It is noted that in other embodiments, entries510 may include additional or different fields from those shown. Forexample, the CRC field may be omitted or implemented elsewhere.Additionally, absolute locations of object data and metadata may bestored in addition to or instead of relative offsets.

Repacker 163 may be configured to operate on the logical object storagespace to remove gaps that may appear when objects 30 are released andtheir associated storage resources are reclaimed. In one embodiment,repacker 163 may be configured to scan the logical object storage space(e.g., periodically or continuously) to identify objects 30 that havebeen marked by SNM controller 161 and/or manager 165 as having beenreleased by a previous release operation. Repacker 163 may then causethe entries 510 of those objects 30 with indexes that appear after theindex of the released object 30 to be updated to reflect the removal ofthe released object 30, which may effectively result in those objects 30shifting towards the origin point of the logical object storage space.For example, if object N in the lower portion of FIG. 5 were to bereleased, repacker 163 may operate to cause the entry 510 correspondingto object N+1 to be updated to reflect the offset field of object N asthe new offset field of object N+1. Repacker 163 may also cause theentry 510 associated with object N to be deleted, and may update theoffsets of objects following object N+1 to reflect the shift. In oneembodiment, manager 165 may cause corresponding shifts of object dataand metadata to occur within the files or structures underlying thelogical object storage space and/or storage devices 169. Thus, in someembodiments, the operation of repacker 163 may reduce fragmentation ofunderlying storage structures and may correspondingly improve the objectaccess performance of node 160.

In some embodiments, manager 165 may be configured to execute onmultiple different execution platforms including different types ofhardware and software. In some such embodiments, one or more additionallayers of abstraction may exist between the logical object storage spacepresented by manager 165 to SNM controller 161 and its clients. Forexample, in the illustrated embodiment, manager 165 may be configured toimplement the logical object storage space as one or more physical filesmanaged by file system 167. Generally speaking, file system 167 may beconfigured to organize various types of physical storage devices 169into logical storage devices that may store data in logical unitsreferred to herein as physical files. Logical storage devices managed byfile system 167 may be hierarchical in nature. For example, file system167 may support a hierarchy of directories or folders that may benavigated to store and access physical files. Generally speaking, filesystem 167 may be configured to track and manage the relationshipbetween a given physical file and the locations of storage devices 169where corresponding data and/or metadata of the physical file arestored. Thus, in one embodiment, manager 165 may manage the mapping ofthe logical object storage space to one or more physical files allocatedby file system 167. In turn, file system 167 may manage the mapping ofthese physical files to addressable locations of storage devices 169.

File system 167 may generally be integrated within an operating system,although any given operating system may support a variety of differentfile systems 167 that offer different features for management ofunderlying devices 169. For example, various versions of the MicrosoftWindows® operating system support file systems such as the NT filesystem (NTFS) as well as the FAT32 (File Allocation Table-32) and FAT16file systems. Various versions of the Linux and Unix operating systemsmay support file systems such as the ext/ext2 file systems, the NetworkFile System (NFS), the Reiser File System (ReiserFS), the Fast FileSystem (FFS), and numerous others. Some third-party software vendors mayoffer proprietary file systems for integration with various computingplatforms, such as the VERITAS® File System (VxFS), for example.Different file systems may offer support for various features formanaging underlying storage devices 169. For example, some file systems167 may offer support for implementing device mirroring, striping,snapshotting or other types of virtualization features.

It is noted that in some embodiments, still further layers ofabstraction may exist between manager 165 and storage devices 169. Forexample, in some embodiments a volume manager layer may be providedbetween file system 167 and storage devices 169, and may be configuredto perform some or all of the virtualization features mentioned above.Alternatively, a particular storage device 169 may be configured as astandalone array of hard disk drives or other devices that includes avirtualization controller. The virtualization controller may beconfigured to present the disk drives to file system 167 as a singlephysical device, although internally the virtualization controller maysupport arbitrarily complex mappings of the device's storage addressspace to the disk drives, similar to virtualization mappings that may besupported by a volume manager or within file system 167 as mentionedabove. It is also noted that in some embodiments, fewer layers ofabstraction than those shown may exist. For example, in someembodiments, manager 165 may be configured to interact directly withstorage devices 169, e.g., as raw physical devices, without using a filesystem 167.

Generally speaking, storage devices 169 may include any suitable typesof storage devices that may be supported by file system 167 and/ormanager 165. Storage devices 169 may commonly include hard disk drivedevices, such as Small Computer System Interface (SCSI) devices or ATAttachment Programming Interface (ATAPI) devices (which may also beknown as Integrated Drive Electronics (IDE) devices). However, storagedevices 169 may encompass any type of mass storage device includingmagnetic- or optical-medium-based devices, solid-state mass storagedevices (e.g., nonvolatile- or “Flash”-memory-based devices), magnetictape, etc. Further, storage devices 169 may be supported through anysuitable interface type in addition to those mentioned above, such asinterfaces compliant with a version of the Universal Serial Bus or IEEE1394/Firewire® standards.

As described above, for any given instance of an object 30 stored withina storage service system, a corresponding locator may uniquely identifythat instance across all of the nodes 160 within the system. In oneembodiment, a locator may be generated as a concatenation, combinationor other function of the object index value that may be assigned to anobject instance by manager 165 as well as a unique identifier or “nodeID” corresponding to the node 160 on which the object instance isstored. For example, as described above, a 64-bit object index value maybe combined with a 64-bit node ID to yield a 128-bit locator. Such alocator would allow for each of as many as 2⁶⁴ unique nodes 160 to storeas many as 2⁶⁴ unique object instances, although smaller or largernumbers of bits may be employed to form locators in various embodiments.

In one embodiment, a node ID may be formed through the concatenation orcombination of a unique network address, such as an Internet Protocol(IP) address corresponding to a given node 160, with a timestamp ordatestamp. For example, a node 160 may be assigned a node ID accordingto its IP address (e.g., at node startup/initialization or at the timethe node ID is assigned, if not during initialization) in combinationwith a timestamp reflecting the time at which the IP address wasassigned, or a time during which the IP address is known to be valid.Generally speaking, two distinct nodes 160 belonging to the same IPaddress space will not validly be assigned the same IP address at anygiven time. Thus, the combination of a node's IP address and a timestampvalue may yield an identifier unique to that node. For example, a 32-bitIP address may be concatenated or combined with a 32-bit timestamp(e.g., that represents the number of seconds elapsed since some commonreference time) to yield the 64-bit node ID referred to above, althoughother bit widths may be employed. It is also contemplated that othertechniques may be employed for assigning unique node IDs that do notdepend on node IP addresses. For example, a central authority such as aname server may delegate node IDs upon request in a fashion thatguarantees the uniqueness of node IDs, similar to the assignment ofobject index values within a node 160 as described above.

It is noted that in embodiments where a node ID is derived from a node'sIP address, the node ID may not reflect the current IP address of a node160 at any given time. For example, the node ID may persist until a node160 is reset, but the node's IP address may be changed or reassignedfollowing generation of the node ID. Also, in some embodiments a node IDmay be hashed, encrypted or obfuscated in a deterministic way in orderto prevent storage clients 50 or other potentially malicious entitiesfrom decoding locators to determine actual node IP addresses.

The operation of exemplary embodiments of get, put and releaseoperations with respect to the embodiment of node 160 of FIG. 4 isillustrated in FIGS. 6-8. Referring first to FIG. 6, a get operation maybegin in block 600 where the operation is received at node 160 from acoordinator 120 or other client. For example, a coordinator 120 mayissue a get operation to a particular locator that includes a node IDand an object index value, as described above. The node ID may be useddirectly to route the get operation to the appropriate node 160, forexample if the node ID reflects the current IP address of the targetnode 160. Alternatively, a directory service such as DFDD 110, describedbelow, may be employed to resolve the node ID of a locator into anaddressable endpoint or destination through which the get operation maybe routed to the appropriate node 160.

Once received by node 160, the get operation may be processed toidentify the extents of the targeted object instance within the logicalobject storage space of node 160 (block 602). For example, controller161 may receive the get operation and convey it to manager 165. In turn,manager 165 may use the object index portion of the locator referencedby the get operation to access index table 500 in order to obtain thelocation of the desired object instance within the logical objectstorage space. For example, manager 165 may obtain the offset into thelogical object storage space where the object instance begins, as wellas the length of the object instance from that offset. In someembodiments, a get operation may specify whether object data, metadata,or both are desired. In such embodiments, manager 165 may determine thelogical object storage extents relevant to the requested data. Forexample, if both object data and metadata are desired, manager 165 mayuse both the object data size and metadata size to determine the extentfrom the object offset to be retrieved. As noted above, in otherembodiments, storage extents for object instances may be stored andmanaged by manager 165 in different ways, such as through absolutelocations rather than relative offsets within the logical object storagespace.

Object extents within the logical object storage space may then bemapped to extents within one or more corresponding files within aphysical file storage space (block 604). For example, manager 165 maymap the logical object storage space to one or more files managed byfile system 167, and may issue appropriate file access operations tofile system 167 to obtain data corresponding to the desired objectextents, e.g., by referencing one or more file names as well aslocations or offsets within the named files to be read. It iscontemplated that in alternative embodiments, controller 161 may beconfigured to bypass the logical block storage space features managed bymanager 165, and may instead interact directly with physical filesmanaged by file system 167.

References to physical files may then be mapped to device-relativerequests (block 606). For example, file system 167 may be configured togenerate one or more read requests to specific addressable locations ofstorage device(s) 169, such as logical block addresses (LBAs) oraddresses specific to device geometries (e.g., cylinder, track, sectorand/or head). As noted above, in some embodiments manager 165 may beconfigured to bypass file system 167 and manage storage device(s) 169directly.

Requested object data may then be retrieved from storage device(s) 169(block 608) and returned to the requesting client (block 610). Forexample, retrieved data may be passed back up through the requesthierarchy shown in FIG. 4, or may be returned directly from storagedevice(s) 169 or file system 167 to controller 161 for conveyance to therequesting client.

As shown in FIG. 7, in one embodiment, a put operation may begin inblock 700 when the operation is received at node 160 from a coordinator120 or other client, in a manner similar to that described above forblock 600 of FIG. 6. For example, a coordinator 120 may issue putoperations to nodes 160 specified in a write plan generated bynodepicker 130. In contrast to a get operation, a put operation mayinclude the object data and/or metadata to be stored, and may optionallyinclude additional parameters specifying the length of the data and/ormetadata.

Once received by node 160, the put operation may be processed to assignstorage extents for the object instance within the logical objectstorage space (block 702). In one embodiment, manager 165 may beconfigured to assign an object index value to the new object instanceand to record in index table 500 a new entry 510 specifying the offsetof the new object instance. For example, the offset of the new entry maybe determined relative to the storage extents (e.g., offset and length)of the existing object instance having the highest index value. If thelength of the data and/or metadata of the new object instance were notspecified as parameters to the put operation, manager 165 or controller161 may be configured to compute these for inclusion in the new entry510.

Newly assigned storage extents within the logical object storage spacemay then be mapped to extents within one or more corresponding fileswithin a physical file storage space (block 704). For example, theassigned extents for the new object instance may be appended to the endof one or more existing physical files, or otherwise located withinexisting or newly allocated physical files. Physical file extents maythen be mapped to storage device extents (block 706), e.g., by filesystem 167 in a manner similar to that described above for getoperations, and the object instance data and/or metadata may then bestored to storage device(s) 169 (block 708).

Upon confirmation that the data and/or metadata has been successfullywritten to storage device(s) 169, a locator corresponding to the storedobject instance may be returned to the requesting client (block 710).For example, manager 165 may be configured to append the generatedobject index value to the node ID of node 160, and may return theresulting value as the object locator upon an indication from filesystem 167 that the physical file write operations successfullycompleted.

As shown in FIG. 8, in one embodiment a release operation may begin inblock 800 when the operation is received at node 160 from a coordinator120 or other client, in a manner similar to that described above forblock 600 of FIG. 6. A release operation may simply specify the locatorof the object instance to be released, although in other embodimentsother arguments may also be supplied.

Like a get operation, once received by node 160, a release operation maybe processed to identify the extents of the targeted object instancewithin the logical object storage space of node 160 (block 802). Forexample, controller 161 may receive the release operation and convey itto manager 165. In turn, manager 165 may use the object index portion ofthe locator referenced by the release operation to access index table500 in order to identify the corresponding entry 510 of the referencedobject instance. The referenced object may then be marked as released(block 804). For example, manager 165 may be configured to set theoffset or another field of entry 510 to an illegal value, such as anegative number, which may signify that the entry is no longer valid. Anacknowledgement may then be returned to the requesting client indicatingthat the object has been released (block 806).

As described above, storage resources associated with an object instancemay not be immediately freed, reclaimed or reallocated for other usewhen the object instance is released. Rather, in one embodiment, thoseresources may persist until an independent process operatingasynchronously with respect to the release operation reclaims them. FIG.9 illustrates the operation of one embodiment of such a process, such asmay be implemented by storage repacker 163, for example. In block 900,an object index entry corresponding to a particular object instancestored on node 160 may be selected. For example, repacker 163 may beconfigured to select index entries 510 from index table 500 insequential order according to the object index values stored in theentries. Subsequently, the selected entry may be examined to determineif the corresponding object instance has been released (block 902). Forexample, repacker 163 may check the offset field or another field toascertain whether the field has been set to a value indicating that thecorresponding object instance has been released, such as a negativevalue or some other value.

If the selected object has not been released, operation may proceed backto block 900 where another object may be selected. If the selectedobject has been released, the logical object storage space may berepacked to reclaim the storage resources corresponding to the releasedobject (block 904). For example, repacker 163 may be configured toadjust the index entries 510 of those object instances that follow thereleased object within the logical object storage space, such that theoffset of the first such object instance is set to the offset of thereleased object, the offset of the next such object instance is set as afunction of the data size, metadata size and offset of the first suchobject instance, and so forth. However, in some embodiments, not all ofthe object instances following a released object instance need berepacked before a new object is selected for examination. For example,repacking may be interleaved with object selection, such that eachobject encountered is repacked when it is selected for examination.

In some embodiments, manager 165 may perform similar repacking orconsolidation operations within the physical file storage space inresponse to the repacking of the logical object storage space. Forexample, manager 165 may cause logical object data extents to beremapped to different physical file data extents. Similarly, in someembodiments file system 167 may perform analogous repacking orconsolidation operations among storage device(s) 169 in response torepacking of the physical file storage space. In other embodiments,repacking of the physical file storage space or the storage devicesthemselves may occur independently of the logical object storage spacerepacking initiated by repacker 163. For example, file system 167 may beconfigured to defragment physical files stored on storage device(s) 169by rearranging the mapping of physical file storage extents to devicestorage extents such that the mapped device storage extents are mostlyor entirely contiguous relative to the access pattern of the storagedevice.

Following repacking of the logical object storage space, the index entrycorresponding to the released object may be deleted (block 906) andoperation may continue from block 900 where another object is selected.As noted above, in some embodiments, repacking may occur “on the fly” asobjects are selected, which may improve overall utilization of thelogical object storage space while minimizing the number of operationsrequired to relocate objects.

It is noted that in some embodiments, any of the get, put, release orother operations that may be supported by node 160 may support varioustypes of handshaking, acknowledgement, or error handling protocols withrespect to the requesting client. For example, if a client requests amalformed request for an operation (e.g., fails to supply a necessaryparameter), or if node 160 cannot satisfactorily complete the operation(e.g., has insufficient resources to honor a put operation), node 160may return an error indication to the requesting client. Such anindication may or may not include specific details regarding the natureof the fault condition.

In one embodiment, a coordinator 120 may be configured to independentlyconvey operations to each respective node 160 targeted by theoperations, even when multiple operations may have data in common. Forexample, in the case of a put operation where an object 30 is beingwritten to multiple nodes 160 according to a write plan, a coordinator120 may independently communicate with each specified node 160. However,in an alternative embodiment, operations having common data and/orparameters that are intended for multiple destination nodes 160 may bechained. In one embodiment, a coordinator 120 or other client mayinitiate a chained operation by specifying each recipient in a parameterof the operation, such as a recipient list. Multiple recipientsindicated in an operation may signify chaining by default, or anotherparameter may be used to mark the operation as chained. The coordinator120 or other client may then initiate the chained operation by conveyingit to a first one of the destination nodes 160 specified in theoperation.

Upon receiving the chained operation, a node 160 may process theoperation and may forward it to another one of the destination nodes 160specified in the operation. Prior to such forwarding, a recipient node160 may remove itself from the list of destinations included in theoperation to signify receipt and avoid circular forwarding. Theoperation may be forwarded concurrently with the recipient node'sprocessing. Alternatively, forwarding may be contingent upon therecipient node's successful completion of processing. In someembodiments, a chained operation may be conveyed to recipients in theorder those recipients are indicated within the operation. In otherembodiments, nodes 160 may dynamically select the next recipient, forexample, by determining which of the remaining destinations is closest,least loaded, or satisfies some other selection criterion. It is notedthat in some embodiments, a combination of chained and non-chainedoperations may be generated by a coordinator 120 or other client. Forexample, if the same data is the target of a put operation destined forsix distinct nodes 160, a coordinator 120 may generate a single chainedoperation specifying the six destination nodes, or two chainedoperations each specifying three of the destination nodes. Othercombinations are also possible, including generation of six non-chainedoperations that coordinator 120 may independently convey to each of therespective destination nodes 160.

Keymap Configuration

As described above, various bitstore nodes 160 may be configured toprovide storage for instances of an object 30. Nodes 160 may not provideany particular support for redundancy or data security individually; infact, in some embodiments nodes 160 may be implemented using genericcomputing platforms running open-source operating systems (e.g., Linux)and providing storage via inexpensive, commodity hard drives (e.g.,ATAPI/IDE hard drives). In such embodiments, individual systems may notbe especially fault-tolerant. Rather, data security and redundancy maybe provided through replication of objects 30 across a number of nodes160, as described above.

As discussed previously, a given object 30 may correspond to a key thatmay be specified by a storage client. Individual instances of the givenobject 30 may correspond to respective locators that may uniquelyidentify those instances across the collection of nodes 160 included inthe storage service system. In one embodiment, each keymap instance 140deployed within the storage service system may be configured to storeand maintain the relationships or mappings between a key and allcorresponding locators for a given object 30 and its replicatedinstances stored among nodes 160. In the discussion below, the generalfeatures and functionality of various embodiments of keymap instance 140are discussed, followed by a description of how a particular embodimentof keymap instance 140 may be implemented.

In one embodiment, a given keymap instance 140 may be configured tostore details of relationships between various keys and associatedlocators within one or more tables or any other suitable type of datastructure. For example, in one embodiment as shown in FIG. 10, a keymapinstance 140 includes a keymap data structure 142 having a number ofentries 144. Each entry includes a respective key 146 as well as anassociated record 148. In some embodiments, as described in greaterdetail below, the organization of the data structure used to organizeentries 144 may be complex. However, from a functional standpoint,keymap instance 140 may generally preserve a one-to-one, table-likerelationship between a given key 144 and its corresponding record 148.

Record 148 may generally include the locator(s) corresponding to a givenkey 144, but may include other information as well. For example, oneembodiment of record 148 may be structured as follows:

struct KeyRecord { int16_t version; int16_t storageClass; int64_tcreationDate; int64_t objectSize; uint32_t crc32; int8_t numLocators;struct locator { int64_t nodeID; int64_t objectIndex; } replicas [ ]; }While this example data structure is expressed using the syntax of the Cprogramming language, it may be implemented using any suitable language,representation or format. Alternative embodiments of record 148 mayinclude more, fewer or different fields than those shown. In someinstances, record 148 may be referred to as an “inode,” drawing on thesimilarity of purpose of record 148 in organizing a storage space to theinode structure employed in certain types of Unix file systems. However,the use of the term “inode” in the present context is not intended toinvoke specific details of the implementation or use of inodes withinfile systems or other storage contexts.

In the above embodiment, record 148 includes seven particular elements.The 16-bit version element may be used to store a unique identifyingvalue that is particular to the format of record 148. For example,different versions of record 148 may be used in differentimplementations of keymap instance 140, and in some embodiments therecords 148 stored within a given keymap instance 140 may beheterogeneous. The version element may be used to distinguish betweendifferent versions of record 148 so that other elements of the recordmay be properly decoded and used.

The 16-bit storageClass element may be used to store an indication ofthe storage class of the object 30 corresponding to a record 148.Storage classes are described in greater detail in a subsequent section.Generally speaking, a given storage class of an object may identifystorage characteristics and/or policies that may be common to othermembers of the given storage class, but may differ from members of otherstorage classes. For example, a “high reliability” storage class and a“low reliability” storage class may be defined for a givenimplementation of the storage service system. Objects 30 that aremembers of the high reliability storage class may be replicated to agreater degree than objects 30 that are members of the low reliabilitystorage class, thus decreasing the sensitivity to loss of an individualreplica, possibly in exchange for a higher usage cost than is assessedfor members of the low reliability storage class. Numerous otherpossible types and combinations of storage classes are possible andcontemplated.

The 64-bit creationDate element may be used to store an indication ofthe date and time the corresponding object 30 was created within thestorage service system. This element may be formatted in any suitablemanner. For example, the date and time may be explicitly encoded asdistinct fields within the element, or a single number representing thenumber of elapsed time units (e.g., seconds, milliseconds, etc.) since acommon point of reference. In some embodiments, the creationDate elementmay include additional fields configured to indicate the date and timeof last modification of any aspect of the corresponding object 30,although in other embodiments a last modification element may beincluded as a distinct element within record 148.

The 64-bit objectSize element may be used to store an indication of thesize of the corresponding object, e.g., in bytes. In some embodiments,this element may reflect the size of both object data and metadata,while in other embodiments these may be stored as distinct fields. The32-bit crc32 element may be used to store an indication of the CyclicRedundancy Check (CRC) checksum computed for the object data and/ormetadata according to any suitable checksum algorithm. For example, thechecksum may be included to verify data integrity against corruption ortampering. In other embodiments, any suitable type of hash or signaturecomputed from object data and/or metadata may be used in addition to orin place of the CRC checksum.

The 8-bit numLocators element may be used to store an indication of thenumber of locators included within record 148 within the replicas[ ]array. Within this array, each locator is stored as a 64-bit nodeIDelement as well as a 64-bit object index value, which may be derived asdescribed above in the discussion on the configuration of bitstore nodes160. In some embodiments, locators may be stored as single elementswithin the replicas[ ] array.

In one embodiment, keymap instance 140 may be configured to provide akeymap API to a keymap client, such as a coordinator 120, as well as toperform those functions necessary to support the provided API. Forexample, a controller 120 may be configured to use the API to store,retrieve, delete or perform other operations on records 148 associatedwith entries 144 managed by the keymap instance 140. Analogous to theoperations on object instances that may be supported by nodes 160 asdescribed above, in one embodiment the keymap API may support put, getand delete operations on keymap entries 144. In one such embodiment, akeymap entry put operation, which may also be generically referred to asa keymap store operation or a keymap write operation, may specify thekey 146 and record 148 to be stored within a keymap entry 144. In oneembodiment, a put operation that specifies a key 146 for which an entry144 already exists may replace the record 148 associated with theexisting entry 144 with the record specified as an argument or parameterof the put operation. Upon completion on a given keymap instance 140, akeymap put operation may return to the requesting client a statusindication, such as whether the operation succeeded or failed, and whattype of failure occurred (if any), for example. In some embodiments, ifa keymap put operation results in replacement of an existing entry 144,keymap instance 140 may be configured to return the previous value ofentry 144 to the requesting client.

A keymap entry get operation, which may also be generically referred toas a keymap read or retrieval operation, may in one embodiment specify akey as a parameter. Upon completion, a keymap get operation may returnto the requesting client the record 148 of the keymap entry 144associated with the requested key, if such an entry exists. If nocorresponding entry 144 exists, an indication to that effect may bereturned to the requesting client.

In one embodiment, a keymap entry delete operation may be configured tooperate similarly to a put operation, except that the requesting clientneed not specify a record to write to the entry. Upon completion on agiven keymap instance 140, a keymap delete operation may return to therequesting client a status indication similar to that of the keymap putoperation. Like the put operation, in some embodiments, keymap instance140 may be configured to return the previous value of the deleted entry144 to the requesting client.

The keymap API may also support other types of operations in variousembodiments. For example, the keymap API may support operations that mayassist keymap clients in managing keymap entries. In one embodiment, thekeymap API may support a list operation that may be configured toidentify those entries 144 having keys 146 matching some criteriaspecified by the requesting client. For example, the list operation mayallow a client to specify a string or pattern as a parameter to theoperation. Upon completion on a given keymap instance 140, the listoperation may return to the requesting client a list of those keys 146that satisfy the specified string or pattern. In one embodiment, a key146 may satisfy a given string only if the string is a proper prefix ofthe key 146 (e.g., the Nth character of the string matches the Nthcharacter of the key, for all characters of the string). In otherembodiments, a key 146 may satisfy a given string if the string can befound at any location within the key 146.

The list operation may support other parameters in some embodiments. Forexample, the list operation may allow a requesting client to specify alimit to the number of matches to be returned. Additionally, therequesting client may specify constraints on the keys 146 to besearched, for example by specifying an open-ended or closed-endedlexicographic range within which the keys 146 to be searched shouldfall. In some embodiments, keymap instance 140 may be configured toreturn records 148 as well as keys 146 that satisfy the list operationcriteria. Also, in some operations, the keymap API may support a countoperation that may support the same types of parameters and executionbehavior as the list operation. However, instead of returning those keys146 and/or records 148 that satisfy the criteria provided by therequesting client, a count operation may return the number of keys thatsatisfy those criteria (e.g., the number of keys that would have beenreturned by a corresponding list operation). It is noted that the keymapAPI may also support other operations not detailed above.

In some circumstances, different keymap clients may seek to modify thesame keymap entry 144. For example, in response to various client- orsystem-driven operations, two different coordinators 120 may attempt toconcurrently change the contents of a given record 148 (e.g., to add,delete or modify locators of replicas), or one may attempt to modify arecord 148 while another attempts to delete the corresponding entry 144.In order to provide a consistent method for resolving concurrentrequests to a given keymap entry 144, in one embodiment the keymap APImay require that at least those keymap operations that update or modifykeymap state (e.g., keymap put and delete operations) provide a sequencenumber as a parameter to the keymap operation. Keymap instance 140 maythen be configured to resolve conflicting updates to an entry 144 bycomparing the sequence numbers (e.g., numerically or lexicographically)and consistently picking one of the operations on the basis of thecomparison. In some embodiments, the provided sequence number may bestored in the modified keymap entry 144 along with the modified record148 for synchronization recovery as described in greater detail below.

For example, a keymap client may generate a sequence number based on atimestamp. In one embodiment, such a timestamp may include a 64-bitnumber formatted as follows. Bit 63 of the timestamp may be set to zero(e.g., to avoid confusion as to whether the timestamp is a signed orunsigned number). Bits 62:32 may include the number of seconds elapsedsince a reference point in time (e.g., Jan. 1, 1970 at midnight,Greenwich Mean Time, a reference time employed by many versions of Unixand Linux). Bits 31:22 may include the number of milliseconds elapsedsince the last second. Bits 21:0 may contain bits generatedsubstantially at random. In other embodiments, the timestamp may begenerated on the basis of different widths or types of fields.Alternatively, a keymap client may employ a completely different basisfor generating sequence numbers. Provided the resolution of the sequencenumber is high, the chance of collision among different sequence numbersprovided by different keymap clients for the same keymap entry 144 maybe low. However, if a collision were to occur, keymap instance 140 maybe configured to resolve the collision using any suitable, consistenttechnique.

In many embodiments, the abstract functional behavior of keymap instance140 in mapping keys to locators may be relatively straightforward. Forexample, as described above, a set of basic operations supported by oneembodiment of a keymap instance 140 may include put, get and deleteoperations configured to manipulate entries 144 that reflectrelationships between keys 146 and locators included within records 148.However, implementation of keymap functionality within a storage servicesystem may present a number of challenges. In particular, if the storageservice system is to support a large number of objects 30 (e.g.,millions or billions of objects 30 totaling terabytes (TB) or petabytes(EB) of storage, or beyond) on behalf of a large number of clients,implementation of the keymap may be required to scale correspondingly incapacity. However, it may not be possible or economically feasible toimplement sufficient system memory resources to represent the entiretyof the information contained in the keymap within a single computersystem. Additionally, for fault tolerance and increased processingthroughput for keymap client requests, multiple replicas of keymap datamay be deployed in a distributed fashion within the storage servicesystem. However, replication of keymap data may lead to keymapsynchronization and consistency issues, for example if one replica wereto be modified while another is being accessed.

Scalability of keymap functionality may be improved by introducinglevels of hierarchy within keymap instances 140. One embodiment of sucha hierarchy is illustrated in FIGS. 11A-D. In FIG. 11A, an examplekeymap deployment 1100 is illustrated. As described above, e.g., withrespect to FIG. 3, in some storage service system embodiments, multiplekeymap instances 140 may be distributed throughout the system, forexample in different data centers 300 or areas 310. Generally, acollection of keymap instances may be referred to as a deployment. Insome embodiments, a storage service system may encompass a single keymapdeployment 1100 including all of the keymap instances 140 provisionedwithin the system, although in other embodiments, a system may includemultiple keymap deployments 1100 unified under additional levels ofkeymap hierarchy.

In the illustrated embodiment, deployment 1100 includes keymap instances140 a-c, each of which is configured to exchange keymap information withthe others, for example according to an instance synchronizationprotocol as described in greater detail below. As shown, each keymapinstance 140 includes a number of hosts 400 configured to communicatewith one another. For example, keymap instance 140 a includes hosts 400a-c, keymap instance 140 b includes hosts 400 d-g, and keymap instance140 c includes hosts 400 h-j. Generally speaking, each host 400 mayinclude a computer system and associated software, and may includeelements such as a processor, system memory, storage devices, networkinginterfaces or other suitable components. For example, one embodiment ofa computer system or node that may be configurable to serve as a host400 is discussed below in conjunction with the description of FIG. 29.

In general, each keymap instance 140 may be configured to maintain acomplete representation of keymap data, including keymap entries 144 aswell as any other data used to index and manage the keymap hierarchy,for all objects 30 stored within the storage service system. Within akeymap instance 140, keymap data may be distributed across hosts 400,such that individual hosts 400 store some (possibly redundant) portionof the keymap data. It is noted that while only a few hosts 400 areshown in FIG. 11A, in other embodiments each keymap instance 140 mayhave any suitable number of hosts 140. For example, in some large-scaleimplementations, dozens or perhaps hundreds of hosts 140 may be includedin a keymap instance 140. It is also contemplated that while in someembodiments, hosts 400 for a given keymap instance 140 may be localizedwithin a given area 310 or data center 300, in other embodiments suchhosts 400 may be distributed among different areas 310 or data centers300. Further, while hosts 400 may be configured to implement onlykeymap-related functionality in some embodiments, in other embodimentshosts 400 may implement functionality related to other elements of thestorage service system. For example, in one embodiment various ones ofhosts 400 may also be configured as bitstore nodes 160, and thus maystore keymap data as well as object data.

FIG. 11B shows an exemplary embodiment of keymap instance 140 a ingreater detail. In the illustrated embodiment, each of hosts 400 a-cincluded within keymap instance 140 a includes a respective partitionindex 410 a-c and an arbitrary number of bricks 415. Generally speaking,a brick 415 may correspond to an intermediate keymap data structurewithin a keymap instance 140. In some embodiments, as described ingreater detail below in conjunction with the description of FIG. 12,keymap data may be separated into partitions among bricks 415, andreplication of partitions within keymap instances 140 may occur at thebrick level. Partition index 410 may be configured to index bricks 415to facilitate selection of one or more particular bricks 415 forprocessing during a keymap operation. For example, partition index 410may be configured as a tree or another suitable data structure. In oneembodiment, partition index 410 as well as deeper index levels withinkeymap instance 140 may be configured as a portion of a particular typeof data structure referred to as a stratified unbalanced tree or trie,which is described in detail in a subsequent section. In the illustratedembodiment, keymap instance 140 further includes keymap coordinator 412.Generally speaking, keymap coordinator 412 may be configured toimplement keymap access management, content management andsynchronization methods or protocols such as those described in greaterdetail below. It is noted that while keymap coordinator 412 isillustrated as distinct from hosts 400, in some embodiments it may beimplemented as a process or module within one or more of hosts 400. Itis also noted that in some embodiments, partition indexes 410 may beimplemented within keymap coordinator 412, rather than separately withinhosts 400.

FIG. 11C illustrates an exemplary embodiment of host 400 a includingbricks 415 a-n. As shown, each of bricks 415 a-n includes a respectiveblock index 420 a-n as well as an arbitrary number of blocks 425.Generally speaking, a block 425 may correspond to an intermediate keymapdata structure within a keymap instance 140, analogous to brick 415, butsubordinate to the brick level of abstraction. Analogous to partitionindex 410, block index 420 may be any suitable data structure configuredfor indexing blocks 425 within a brick 415. For example, block index 420may be configured as a portion of a stratified unbalanced tree in oneembodiment.

As shown in FIG. 11D, in one embodiment blocks 425 may be configured toinclude an arbitrary number of individual keymap entries 144 a-n as wellas an entry index 430 configured to index entries 144 for selection. Asdescribed previously, each of entries 144 a-n may include an indicationof a respective key 146 a-n as well as a respective record 148 a-n.

The relationships among the hierarchical layers between keymap instances140 and keymap entries 144 of the embodiment illustrated in FIGS. 11A-Dare summarized in FIG. 12. At the deployment level of abstraction thatincludes multiple keymap instances 140, a particular keymap instance 140may reference a partition index 410 at the instance level ofabstraction. The referenced partition index 410 may identify the brickor bricks 415 that correspond to a particular entry 144. For example, inthe illustrated embodiment, all keymap entries are replicated by threedistinct partitions corresponding to distinct bricks 415. A given brick,in turn, may reference a particular block 425 (not shown in FIG. 12) viablock index 420, and the referenced block may refer to a particularentry 144 via entry index 430. It is noted that while a keymap may beimplemented using a hierarchical implementation such as shown in FIG.12, other implementations are possible. Broadly speaking, it iscontemplated that keymap instances 140 may be implemented using anysuitable technique for associating keys 144 with records 148. Forexample, in one embodiment a keymap instance 140 may be implementedusing a conventional database or other type of structured index.

It is noted that some of the hierarchical layers in the embodiment ofFIG. 12 may be configured to provide redundancy (e.g., the replicationof keymap instances 140 within the deployment level as well as thereplication of bricks 415 at the partition level) while other layers maybe configured to provide scalability. For example, the distribution ofindexing across multiple distinct levels (e.g., partition index 410,block index 420 and entry index 430) may facilitate scaling of the datastructure by allowing each portion of the index to grow in a manageableway as the number of entries 144 to be indexed within the keymapdeployment increases. It is noted that in other embodiments, more orfewer levels of hierarchy as well as different combinations of redundantand non-redundant levels may be employed.

As with objects 30, the use of replication within layers of the keymaphierarchy may improve fault tolerance by decreasing sensitivity to theloss of individual replicas. However, if no attempt is made tosynchronize replicas of keymap data as modifications occur, the correct(e.g., most current) state of the keymap may become ambiguous, which mayin turn lead to unpredictable or erroneous system operation. In someembodiments, replicated portions of keymap data may be updated in astrictly synchronous fashion using atomic or transactional semantics(e.g., two-phase commit semantics) in which updates may not be reportedas complete to a keymap client until they have durably and verifiablycompleted with respect to every replica. While atomic update semanticsmay minimize or even eliminate the possibility of updates leaving keymapdata in an inconsistent state, the performance of atomic updates maydegrade considerably in a distributed environment of considerable scale.For example, if replicas of keymap data are widely distributed, replicaaccess latency from the perspective of the client may vary considerably,with the slowest replica dictating the overall time required to completean update operation. Moreover, if one replica should fail, strict atomicupdate semantics may cause clients to stall until the failure iscorrected, which may lead to unacceptable delays to clients.

Other types of synchronization protocols that may provide better clientperformance than atomic protocols may be employed within the keymaphierarchy. In some embodiments, a hybrid synchronization approach may beimplemented in which one type of synchronization protocol may beemployed with respect to replicas within a particular keymap instance140 (e.g., replicas at the partition level, as shown in FIG. 12), whileanother type of protocol may be employed to synchronize different keymapinstances 140 within a keymap deployment. Such a hybrid approach mayallow synchronization overhead to be tailored more specifically to theusage dynamics of replicas at different levels within the keymaphierarchy.

For example, keymap data accesses may exhibit locality of reference suchthat repeated requests to particular entries 144 are more likely to bedirected to a specific keymap instance 140 (e.g., the instance closestto the requesting client in terms of geography, network topology oranother suitable criterion) than to another keymap instance 140. Thatis, it may be the case that replicas of keymap data within a givenkeymap instance 140 may be more likely to be accessed by a given clientthan corresponding keymap data in a different keymap instance 140.Correspondingly, in some embodiments replicas within a given keymapinstance 140 may be synchronized using a protocol that may be configuredto converge (e.g., to propagate changes among replicas) more quicklythan a protocol used to synchronize distinct keymap instances 140.

In one embodiment, synchronization of keymap data replicas within agiven keymap instance 140 may be performed using a suitable version of aquorum protocol. Generally speaking, an update or modification ofreplicas of keymap data (including keymap entry put and deleteoperations) performed according to a quorum protocol may be deemedcomplete with respect to a requesting client when the modification hasbeen durably (e.g., completely and persistently) performed with respectto at least a quorum number of replicas. Similarly, a keymap entry getoperation performed according to a quorum protocol may be deemedcomplete when the same data has been read from at least a quorum numberof replicas. In some embodiments, the quorum number may be defined as asimple majority of the number of replicas present, while in otherembodiments arbitrary degrees of supermajority may be employed. It isnoted that a quorum protocol operation may fail to complete if thequorum requirement is not met. However, if the quorum number of replicasis smaller than the total number of replicas, the probability of a givenquorum protocol operation failing may be less than that of an atomicprotocol operation, which effectively requires a consensus amongreplicas rather than a quorum. It is noted that quorum protocols otherthan the one described herein may be employed by keymap instances 140.For example, a multi-phase commit protocol such as Paxos or two-phasecommit may be employed to implement quorum-type keymap semantics.

In the course of normal operation of read and update operationsaccording to a quorum protocol, it is possible for an update to fail tobe propagated to every replica, for example due to communicationfailures or failure of resources underlying a replica. In oneembodiment, disagreement among replicas may be detected and repairedduring a read operation. Specifically, if different values are detectedamong different replicas of a particular entry 144 during a keymap entryget operation, a keymap put operation may be generated to reconcile thedifference. In one embodiment, the entry 144 used as the basis for theput operation may be the entry with the most recent (e.g., numericallyor lexicographically highest) associated timestamp among the differentvalues read. Thus, discrepancies among replicas may be resolved “on thefly,” e.g., as keymap entry get operations are processed, withoutrequiring a distinct process or operation to repair the discrepancies.

The operation of exemplary embodiments of keymap entry put, get, deleteand list operations with respect to an embodiment of keymap instance 140configured to implement a quorum protocol is illustrated in FIGS. 13-14.In various embodiments, these methods may be implemented within a keymapcoordinator process that may be configured, for example, within one ormore of the hosts 400 included within keymap instance 140, or as aseparate process or system within keymap instance 140 such as keymapcoordinator 412 shown in FIG. 11B. Referring first to FIG. 13, a keymapentry put operation may begin in block 1300 when the operation isreceived at keymap instance 140 from a coordinator 120 or other keymapclient. For example, in response to storing a corresponding objectinstance of a particular object 30 to a particular bitstore node 160, acoordinator 120 may generate a keymap entry put operation in order toupdate the entry 144 of the object 30 to reflect the locator of thestored object instance.

The hierarchy of keymap instance 140 may then be navigated to identifythe replicas corresponding to the keymap entry put operation (block1302). For example, for the embodiment of FIG. 12, partition index 410may be consulted to determine which bricks 415 replicate the entry 144corresponding to the object 30 of interest. Subsequently, individual putoperations may be directed to the identified replicas (block 1304). Foreach put operation, the remaining hierarchy of keymap instance 140 maybe navigated to access and modify the corresponding entry 144 (block1306). For example, within a given brick 415, block index 420 and entryindex 430 may be traversed in order to access the specified entry 144.Once a given replica of an entry 144 has been successfully written, thecorresponding put operation may indicate success (block 1308). It isnoted that the individual put operations targeting respective replicasof an entry 144 may execute concurrently. Correspondingly, multipleinstances of blocks 1306-1308 are shown in parallel.

Success indications of the individual replica put operations may bemonitored to determine whether the quorum number of replicas has beensuccessfully updated (block 1310). For example, in an embodimentincluding three replicas, the quorum number of replicas for completionof a keymap entry put operation may be two. If the quorum number ofreplicas has been successfully updated, an indication that the requestedkeymap entry put operation has completed may be returned to therequesting client (block 1312). If not, monitoring may continue. In someembodiments, a timeout may be enforced, such that if a keymap entry putoperation does not complete within a specified period of time afterprocessing begins, the operation may be terminated and an errorindication may be returned to the requesting client. In otherembodiments, a keymap entry put operation may remain pendingindefinitely until it completes.

In one embodiment, a keymap entry delete operation may be implemented asa special case of a put operation. In such an embodiment, a keymap entry144 may include an additional field configured as a deletion sentinel orflag field, and a delete operation may execute as a put operationconfigured to set the deletion field to an asserted status (e.g., bysetting the field to a particular value, such as ‘1’). Those entries 144having asserted deletion fields may be disregarded during future keymapoperations. In some such embodiments, a separate process may beconfigured to independently iterate through keymap instance 144 to purgethose entries 144 having asserted deletion fields. In other embodiments,such entries 144 may be retained indefinitely as a log of historicalkeymap behavior.

One embodiment of a method of operation of a keymap entry get operationis illustrated in FIG. 14. Operation may begin in block 1400 when theget operation is received at keymap instance 140 from a coordinator 120or other keymap client. For example, in response to a request from astorage client 50 for object data corresponding to a particular key,nodepicker 130 or a coordinator 120 may generate a keymap entry getoperation in order to obtain a locator corresponding to the particularkey, so that a bitstore node 160 may be accessed to retrieve the objectdata as described in the previous section.

As with a keymap entry put operation, the hierarchy of keymap instance140 may then be navigated to identify the replicas corresponding to thekeymap entry get operation (block 1402). Subsequently, individual getoperations may be directed to the identified replicas (block 1404). Foreach get operation, the remaining hierarchy of keymap instance 140 maybe navigated to access and retrieve the corresponding entry 144 (block1406). Once a given replica of an entry 144 has been successfullyretrieved, the corresponding get operation may indicate success (block1408). It is noted that, as with the individual put operations describedabove and shown in FIG. 13, the individual get operations targetingrespective replicas of an entry 144 may execute concurrently, and blocks1406-1408 are correspondingly shown in parallel.

Success indications of the individual replica get operations may bemonitored to determine whether the quorum number of replicas has beensuccessfully read (block 1410). If not, monitoring may continue untiladditional replicas have been read. As for the keymap entry putoperation described above, in some embodiments a keymap entry getoperation may wait indefinitely until the quorum number of replicas hasbeen successfully read. In other embodiments, a keymap entry getoperation may time out after a period of time, after which an errorindication and/or the best data available at the time (e.g., the replicadata having the most recent timestamp) may be returned to the requestingclient.

If the quorum number of replicas has been successfully read, it may bedetermined whether the content of the retrieved replicas differs (block1412). For example, the entirety of each replica of the requested entry144 may be compared against each other retrieved replica, or onlycertain fields of the entry 144 (e.g., certain fields of record 148) maybe compared. If there is no difference among the retrieved replicasaccording to the criteria used in the comparison, the retrieved data maybe returned to the requesting client along with an indication that thekeymap entry get operation is complete (block 1414).

If a difference among replicas exists, one of the replicas may beselected according to a selection criterion (block 1416). For example,the criterion may include considering the timestamp value of eachreplica, where the replica having the highest timestamp value may beselected. A keymap entry put operation may then be initiated using thedata of the selected replica (block 1418). For example, the putoperation may be performed according to FIG. 13 as described above. As aresult of the put operation, a quorum number of replicas of theoriginally-requested entry 144 may be written with the contents of theselected replica, decreasing the likelihood that a future get operationwill encounter a discrepancy among replicas. Following the putoperation, the data of the selected replica may be returned to therequesting client along with an indication that the keymap entry getoperation is complete (block 1414). In some embodiments, completion ofthe get operation in the case of a detected discrepancy among replicasmay be contingent upon completion of the put operation initiated toresolve the discrepancy, while in other embodiments, the get operationmay be indicated as complete to the requesting client independent ofwhether the consequent put operation has completed.

As discussed above, in some embodiments the keymap API may supportkeymap entry list or count operations configured to indicate those keys146 of keymap entries 144 that satisfy some criterion, such as a searchpattern. In one embodiment, list and/or count operations may beimplemented as a special case of keymap entry get operations, where foreach entry 144 that satisfies the criteria of a given list or countoperation, a corresponding keymap entry get operation is performed.However, the additional overhead of actually retrieving entry data(e.g., records 148) from multiple replicas according to a quorumprotocol may be unnecessary for keymap entry list or count operations.Thus, in some embodiments, those steps of the keymap entry get operationthat are concerned with the quorum protocol may be omitted from a keymapentry list or count operation. For example, rather than identifying allreplicas of a given entry and generating individual get operations foreach replica as in blocks 1402-1404, for a list or count operation asingle replica (e.g., a brick 415) may be arbitrarily selected and itscorresponding hierarchy navigated in order to identify each entry 144that satisfies the list or count operation criteria. For the resultingentries 144 that satisfy the criteria, corresponding keys 146 or a countof the resulting entries 144 may be returned to the requesting client,bypassing the quorum-related processing portions of FIG. 14 (e.g.,blocks 1410-1418).

In some embodiments, a keymap instance 140 may implement a cache inaddition to the various data structures used to index entries 144. Forexample, a cache may allow keymap operations directed to keys offrequently used entries 144 to bypass navigation of index datastructures in order to directly access corresponding entries 144, whichmay improve the performance of keymap entry get operations.Additionally, a cache may help prevent hosts 400 associated withpopular, frequently accessed keys from becoming overloaded by keymaprequest traffic. For example, in one embodiment where the keymap cacheis distributed among hosts 400, a copy of a key may be cached on adifferent host 400 than the host 400 that maintains index datastructures for the key. Through such distribution of key caching amonghosts 400, key processing workload may be more evenly shared among hosts400.

In one embodiment, a keymap cache may be configured to store and beindexed by hashes of keys 148 rather than the keys themselves. Datahashing, discussed in greater detail below in conjunction with thediscussion of unbalanced index data structures, may constitute anefficient technique for representing variable length data, such as a key148, in a fixed-length data structure, which may be easier to managewithin the keymap cache. Additionally, various hash algorithms maygenerate evenly distributed hash values for data that may not beinitially evenly distributed (e.g., a set of keys 148 having aconsiderable portion of data in common), which may facilitate theuniform distribution of keymap cache data among hosts 400. In someembodiments, the contents of an entry 144 may be stored in the keymapcache along with a hashed value of the corresponding key 148. In otherembodiments, pointer or other reference information for entry 144 may bestored rather than the contents of entry 144 itself.

Generally speaking, in keymap embodiments including keymap caches,keymap entry put and get operations may operate with minor modificationsto the description provided above. In one embodiment, keymap entry getoperations may first consult the cache to determine whether the getoperation can be serviced from the data resident in the cache. A getoperation may wait for a fixed amount of time for a response from thecache before proceeding with the quorum protocol for reads. If the cachereturns a value after the quorum protocol read is initiated, the valueread from the cache may be processed and the corresponding entry 144returned, and the quorum protocol read may be terminated. If no value isreturned from the cache, the entry 144 read from the quorum protocolread operation, or a pointer to such an entry 144, may be installed inthe keymap cache along with corresponding key information.

Generally speaking, keymap entry put operations in keymap embodimentsthat include caches may operate substantially as described above, exceptthat a locking or other consistency protocol may be employed to preventmultiple put operations from concurrently attempting to modify the samecache entry. In one embodiment, a keymap entry put operation may beconfigured to attempt to lock a cache entry corresponding to a key 148before commencing the quorum protocol for writes. Upon receiving aresponse from the cache that the lock request succeeded (e.g., becauseno other lock on the entry exists, or because there is no correspondingentry in the cache), the quorum protocol may proceed. After the putoperation is complete according to the quorum protocol, the lock may bereleased and the new entry data may be installed in the cache.

It is noted that in some embodiments, the quorum protocols for keymapentry put and get operations as just described may implement a strongconsistency model for updating keymap entry state. That is, the quorumprotocols may guarantee that once a put operation to a particular keyhas been acknowledged to a client as complete, a subsequent getoperation will return the data that was most recently put, even if notevery replica has been updated at the time the get operation isprocessed.

As keymap operations such as put and delete operations are directed to aparticular keymap instance 140, the state of entries 144 within thatparticular keymap instance 140 may change over time. Thus, in theabsence of any attempt to reconcile them, different keymap instances 140within a deployment may tend to become divergent or inconsistent overtime. If only one storage service client 50 references a given object30, and does so via the same keymap instance 140, such divergence mayhave no practical effect. However, if multiple storage service clients50 refer to the same key via different keymap instances 140, suchinconsistency may cause clients 50 to observe different keymap stateand/or different versions of object data at the same point in time.

As described previously, strong consistency protocols such as atomic orquorum protocols may be employed when updating replicas to effectivelyprevent clients from observing replica inconsistency or to prevent suchinconsistency from arising at all. However, in a distributed contextwhere access latency of different replicas may vary, sometimesconsiderably, strong consistency protocols may have a high performancecost. For example, for an atomic or quorum protocol, the time requiredfor operation completion may be a function of the time required tocomplete the operation with respect to the slowest of all the replicasor of the quorum number of replicas, respectively. Moreover, in theabsence of strong consistency protocols, the probability of replicainconsistency becoming visible to a client (e.g., the probability of astorage service client 50 obtaining stale keymap or object data) maygenerally be a function of the probability of a client accessing areplica during a period of time when the accessed replica does not yetreflect an update.

For many objects 30, this latter probability may be low. For example, insome instances, the majority of objects 30 managed by the storageservice system may be accessed by a single client 50 via a particularkeymap instance 140, in which case inconsistency may be moot from aclient perspective. For objects 50 that may be accessed by multipleclients 50, observable inconsistency may still be unlikely. For example,two keymap instances 140 are inconsistent with respect to a particularkey for a period of, say, ten seconds. However, if no access isperformed with respect to the particular key during the period ofinconsistency (e.g., if the duration between accesses of thecorresponding object 30 is greater than the period of inconsistency), orif an access that is performed is directed to the more recently updatedkeymap instance 140 (e.g., if the client 50 that last updated the stateof a key is the next to reference the key via the same keymap instance140), the inconsistency may have no observable effect on clients 50.Consequently, in some embodiments keymap instances 140 may employ arelaxed synchronization protocol that strives to converge keymapinstances 140 to a consistent state, but which may allow some degree ofinconsistency among keymap instances 140 at any given time. Such asynchronization protocol may provide better overall performance for themajority of clients 50 for which stricter synchronization may beunnecessary. In some embodiments, clients 50 that require stricteraccess synchronization of keymap data for shared objects 30 mayimplement additional protocols among themselves, without requiring thatall clients 50 incur the burden of stricter synchronization. Forexample, a set of clients 50 that share access to a particular set ofobjects 30 may employ semaphore or other distributed locking techniquesto coordinate their access to keymap data.

In some embodiments, relaxed synchronization protocols among keymapinstances 140 may include a combination of different synchronizationtasks that may independently carry out different aspects of thesynchronization process. FIGS. 15A-B illustrate one embodiment of amethod of operation of a relaxed synchronization protocol that includestwo distinct synchronization tasks: an update propagation task shown inFIG. 15A, and an anti-entropy or set reconciliation task shown in FIG.15B. Referring first to FIG. 15A, operation begins in block 1500 wherean update to one of keymap instances 140 may be detected. For example, akeymap instance 140 may receive and complete a keymap entry put ordelete operation according to a quorum protocol as described above.

The keymap instance 140 that processed the keymap update may thenforward the update operation to each other keymap instance 140provisioned within the storage service system (block 1504). For example,if keymap instance 140 a processed a keymap entry put operation, it mayforward the operation including arguments, parameters, etc. to keymapinstances 140 b and 140 c. In one embodiment, the forwarding may beperformed without verification or acknowledgement. For example, thekeymap instance that processed the keymap update operation may forwardthe operation using a “fire and forget” protocol, making one attempt toforward the operation to each other keymap instance without attemptingto verify whether the forwarded operation was received at itsdestination or to resend the operation if it was not received. Suchforwarding may occur using any suitable forwarding strategy, such asconcurrent broadcast from the originating keymap instance 140 tomultiple keymap instances 140, sequential forwarding from theoriginating keymap instance 140 to other instances, tree-basedstrategies, etc.

Those associated hosts 400 that receive the forwarded operation mayperform the update operation locally (block 1506). For example, if host400 f successfully receives a keymap entry put operation forwarded fromhost 400 a, it may perform the operation as if it had received theoperation from any keymap client. If the put operation successfullycompletes on host 400 f, then as a result, keymap instances 140 a and140 b may be synchronized with respect to the put operation.

Generally speaking, it may be expected that forwarding keymap updateoperations among hosts 400 will succeed a majority of the time.Therefore, minimizing the overhead involved in forwarding suchoperations may decrease the time and/or bandwidth required to achievesynchronization among keymap instances 140 in a majority of cases. Forexample, eliminating acknowledgement responses or other types ofprotocol verification or handshaking from the forwarding process mayfree communications bandwidth for other uses, such as to support alarger scale of keymap implementation involving a greater degree ofsynchronization traffic. In many instances, the time required topropagate keymap updates throughout a keymap deployment (which maygenerally correspond to the window of potential inconsistency ofreplicas of a given keymap entry 144) may be limited to thecommunication latency required to forward the operation to associatedhosts 400 and the processing latency required for hosts 400 to apply theforwarded operation. Frequently, this total time may be on the order ofseconds or fractions of seconds.

In some instances, however, forwarding of keymap update operations amonghosts 400 may fail. For example, a communication link failure may renderone host 400 unreachable from another, or may cause a forwardedoperation to be lost, truncated or otherwise damaged in transit.Alternatively, a destination host 400 may fail to receive or correctlyprocess a properly forwarded update operation, for example due totransient hardware or software issues. If, as in one embodiment, noattempt is made on the part of an originating host 400 to verify orassure that forwarded keymap update operations are successfully receivedand processed by targeted hosts 400, forwarding failure of individualoperations may result in inconsistency among keymap instances 140 withrespect to certain entries 144.

Correspondingly, in one embodiment a relaxed synchronization protocolamong keymap instances 140 may include the anti-entropy or setreconciliation task mentioned above and shown in FIG. 15B. This task maybe referred to as an “anti-entropy” task in that generally, operation ofthe task may serve to reduce differences and increase similarities amongdifferent keymap instances 140, thus decreasing the overall entropyamong keymap instances 140 that may be introduced by random or systemicfailure of update propagation to properly synchronize instances. In theillustrated embodiment, operation begins in block 1510, where aninitiating keymap instance 140 randomly selects another keymap instance140 with which to perform a reconciliation of a particular partition,which as described above may include a number of replicated bricks 415resident on different hosts 400.

The initiating keymap instance 140 may then exchange information aboutthe partitions within the instance with the selected keymap instance 140(block 1512). For example, particular hosts 400 within the two keymapinstances 140 may be configured to exchange copies of the partitionindex 410 maintained within each instance, which may in turn identifythose bricks 415 defined within each instance.

Based on the exchanged partition information, the initiating keymapinstance 140 may then identify correspondences between partitions in thetwo instances (block 1514) and may reconcile each partition within theinitiating keymap instance 140 with a corresponding partition within theselected keymap instance 140 (block 1516). For example, as describedpreviously, each partition within a given keymap instance 140 may bereplicated across a number of bricks 415. In one embodiment, theinitiating keymap instance 140 may be configured to direct a particularbrick 415 within a partition (which may be referred to as the “leadbrick”) to communicate with a corresponding or “peer” brick 415 of acorresponding partition within the selected keymap instance 140 in orderto reconcile differences between the partitions. In one embodiment,reconciliation of two bricks 415 may involve the bricks exchanginginformation about differences in the keymap entries 144 included in eachbrick 415, and then propagating the most current information within eachkeymap instance 140. For example, if one brick 415 determines on thebasis of timestamp information that its version of an entry 144 is morecurrent than that of a peer brick 415, it may communicate the entry datato the peer brick 415. Subsequently, the peer brick 415 may perform akeymap entry put operation (e.g., according to a quorum protocol asdescribed in detail above) to update its copy of the entry 144.

Once partition reconciliation between the two keymap instances 140 hascompleted, operation may continue from block 1510 where thereconciliation process is initiated again with respect to another randomkeymap instance 140. In various embodiments, each keymap instance 140may be configured to perform this process at predetermined ordynamically determined intervals. For example, reconciliation may occurat a static rate of once per minute, or at intervals determinedaccording to a random or other statistical probability distribution. Insome embodiments, reconciliation may be performed after a certain numberof keymap accesses have occurred, or after access to certain individualones, types or groups of keymap entries has been detected.

Generally speaking, the methods of update propagation and setreconciliation or anti-entropy shown in FIGS. 15A-B may operate in acomplementary fashion. Under the majority of circumstances, updatepropagation may satisfactorily synchronize different keymap instances140 within a deployment. In those instances where keymap inconsistenciesarise due to the failure of update propagation, the anti-entropy taskmay generally operate to reconcile such inconsistencies. It is notedthat in some embodiments, execution of the anti-entropy task may notguarantee that two keymap instances 140 are precisely synchronized intheir entirety. However, in one embodiment the anti-entropy task may beimplemented to guarantee that its operation will not increase the degreeof inconsistency between two keymap instances 140. Thus, over repeatedapplications, the anti-entropy task may facilitate convergence of keymapinstance 140. More details on one particular embodiment of theanti-entropy task are provided below in conjunction with the descriptionof specific embodiments of data structures with which keymap instance140 may be implemented.

As shown in FIG. 2 and discussed above, in some embodiments a storageservice system may include a replicator keymap instance 190 in additionto other keymap instances 140. In one embodiment, replicator keymapinstance 190 may be configured essentially identically to keymapinstances 140 described above, and may participate in keymapsynchronization using the protocols discussed above. However, in such anembodiment, replicator keymap instance 190 may be configured to servereplicator 180 rather than coordinators 120 or other keymap clients. Insome circumstances, segregating replicator keymap instance 190 fromother keymap instances 140 may improve keymap performance in general.For example, replicator 180 may generate a substantial amount of keymaprequest traffic as it iterates through the keymap to check on the healthand number of replicas of objects 30. If commingled with keymap trafficgenerated on behalf of requests of storage service clients 50,replicator keymap traffic might negatively impact response time or otherquality-of-service measures pertinent to clients 50. By contrast,configuring replicator 180 to make use of a dedicated keymap instance190 may isolate internally-generated keymap traffic fromclient-generated traffic. Additionally, such segregation may betterenable the implementation of each type of keymap instance to be scaledaccording to the requirements of its major client. For example, theimplementation of replicator keymap instance 190 might be configured tofacilitate processing of a large number of concurrent keymap operationsrather than to minimize the latency of any given keymap operation,whereas keymap instances 140 may be optimized for a differentcombination of quality-of-service criteria. However, it is noted thatsegregation of keymap instances in this fashion is not required, and insome embodiments, replicator 180 may be a client of keymap instances 140rather than of a dedicated replicator keymap instance 190.

In one embodiment, replicator keymap instance 190 may also be configuredto facilitate accounting of usage of storage service system resources byclients 50. Specifically, replicator keymap instance 190 may beconfigured to augment the entries 144 stored by keymap instances 140with additional data indicative of a respective entity that bearsbilling or other financial responsibility for the corresponding objects30. For example, in the embodiment illustrated in FIG. 16, a replicatorkeymap entry 194 is shown. Within replicator keymap instance 190, entry194 may function identically to entries 144 with respect to thestructure and hierarchy of keymap instances 140. However, in theillustrated embodiment, entry 194 includes the additional field, bucketID 196. Generally speaking, bucket ID 196 may include an indication ofthe identifier of the bucket 20 that includes an object 30 correspondingto a key 146. Such an identifier may be defined, for example, by webservices interface 100 or coordinator 120 as described above in responseto a request from a client 50 to create a bucket 20 in which to storeobjects 30. It is noted that in other embodiments, accountinginformation need not be reflected solely within the entries ofreplicator keymap instance 190. For example, in one embodiment thekeymap entries 144 of some or all keymap instances 140 may be configuredto store an indication of bucket ID 196, for example as an additionalfield within record 148 or key 146.

As discussed above, the relationship between objects 30 and buckets 20may be transparent to the general operation of keymap instances 140.However, given that this relationship is typically static, explicitlyassociating buckets 20 and objects 30 via replicator keymap entries 194may facilitate accounting and billing of clients 50. For example, ratherthan explicitly querying web services interface 100 for the bucket 20associated with each object 30, an accounting process (which may beincluded within replicator 180 or another module, or implemented as adistinct module within the system) may be configured to sort replicatorkeymap entries 194 according to bucket ID 196. Upon completing such asort, all keys 146 associated with a particular bucket ID 196 would bereadily apparent. The sizes of corresponding objects 30 as indicatedwithin records 148 may then be aggregated to determine the total storageresource utilization associated with a bucket ID 196. Additionally,other characteristics of objects 30 may be taken into account, such asthe class of storage associated with a particular object 30. Resourceutilization may then be monetized according to a suitable billing model.

In various embodiments, replicator keymap entries 194 may include otherfields instead of or in addition to bucket ID 196 that may facilitatevarious internal system maintenance or accounting tasks. It is notedthat in embodiments where replicator keymap instance 190 is distinctfrom other keymap instances 140, the storage cost of such additionalfields may be configured to replicator keymap instance 190. However, itis contemplated that in embodiments lacking a dedicated replicatorkeymap instance 190, entries 144 of keymap instances 140 may beaugmented to include such additional fields.

Stratified Unbalanced Data Structures

As described previously, in some embodiments a storage service systemmay scale to support very large numbers of objects 30, e.g., on theorder of billions or more. Thus, in such embodiments, each keymapinstance 140 will have a similar number of entries 144 to manage. Insome embodiments, keymap instances 140 may support various types ofsorting and/or grouping operations, such as the keymap entry list andcount operations discussed in the previous section. Additionally, tosupport consistent keymap operation, the many keys managed by eachkeymap instance 140 may need to be synchronized among other keymapinstances 140 as described above.

In many circumstances, the keymap functionality provided by keymapinstances 140 may be central to the operation of the overall storageservice system. For example, if clients 50 elect not to performlocator-based access to specific instances of objects 30, keymapinstances 140 may mediate every key-based object access requestperformed by clients 50. Thus, the performance of the storage servicesystem as seen by clients 50 may depend directly on the efficiency andspeed with which keymap instances 140 access and process keymap entries144. In turn, the performance of keymap instances 140 may dependdirectly on the data structures used to index and organize entries 144,such as the data structures used to implement partition indexes 410,block indexes 420 and entry indexes 430 in the embodiment of FIG. 12.

Designing index data structures to support sorting and synchronizationoperations in a large-scale keymap implementation may presentconsiderable challenges. Conventional applications that require indexingof large amounts of data, such as, e.g., databases, frequently employconventional balanced data structures, such as B-trees or other types ofbalanced trees. Generally speaking, when used to index a given quantityof data items such as keymap entries 144, balanced data structurealgorithms attempt to distribute data items across the balanced datastructure according to the quantity of items being managed. For example,given 10,000 keymap entries 144 to index, a balanced data structurealgorithm may attempt to choose breakpoints among the entries 144 suchthat the entries are divided into 10 groups of roughly 1,000 entries pergroup. The balanced data structure algorithm may create further levelsof balanced hierarchy within each group, for example, subdividing eachgroup of roughly 1,000 entries into five subgroups of roughly 200entries each. As data items are added to and deleted from the balanceddata structure, groups and/or subgroups within the data structure maybecome unbalanced. Thus, conventional balanced data structure algorithmsmay rebalance the data structure by reallocating data items amonggroups, creating additional groups, and/or creating additional levels ofhierarchy. Such rebalancing may take place “on the fly” as data itemsare added or deleted, or may occur after a certain number of data itemmodifications have taken place or a certain amount of time has elapsedsince the last rebalancing.

By virtue of segregating data items in a balanced fashion, balanced datastructures may present a predictable, roughly uniform access latency forany given data item within the data structure, which may be desirable ina large-scale implementation where a large number of data items need tobe indexed. However, it may be particularly difficult to efficientlyreconcile or synchronize distributed instances of balanced datastructures, for example using a relaxed synchronization model asdescribed above. Specifically, as instances of balanced data structuresare independently modified, the breakpoints that divide data items intogroups within each instance may become divergent. As a result, there maybe no direct correspondence in terms of data item membership betweengroups or subgroups of different balanced data structure instances. Toreconcile two such instances, then, it may be necessary to exhaustivelycompare the entirety of the two instances, which may be extremelytime-consuming in cases where each instance indexes a large number ofdata items.

As an alternative to balanced data structures that distribute data itemsamong groups according to quantity, in some embodiments the index datastructures of keymap instances 140 may be configured to implementunbalanced data structures (which may also be referred to as tries) thatdistribute data items among groups according to some relationship amongthe data items within each group. Specifically, keymap instances 140 maybe configured to index entries 144 according to prefixes of theircorresponding keys 146. As an example, consider a case in which thereexist 600 keymap entries 144 having corresponding case-insensitivealphanumeric keys 146. A balanced index of these 600 entries mightdivide the entries into three balanced groups of 200 entries each. Bycontrast, in one embodiment an unbalanced index might define threealphanumeric groups such that those entries beginning with thecharacters a through l are assigned to the first group, those entriesbeginning with the characters m through x are assigned to the secondgroup, and those entries beginning with the characters y or z or thenumerals 0-9 are assigned to the third group.

Entries 144 may be unevenly distributed across the groups of theunbalanced index. For example, there may be 300 entries in the firstgroup, 250 entries in the second group and only 50 entries in the thirdgroup. However, it is noted that for any given entry 144, membership ofthe given entry 144 in a particular group of an unbalanced index may bea function of its corresponding key 146 without dependence on the numberof entries 144 in any particular group. Thus, if two instances of anunbalanced index maintain the same group definitions, each group may beindependently synchronized without dependence on the other groups. Forexample, the a-l groups between the two instances may be synchronizedindependent of the m-x groups and the y-9 groups. By contrast, asdescribed above, synchronization of two instances of a balanced index ofthe same set of entries 144 may require all entries across all groups tobe considered.

One example illustrating the use of an unbalanced data structure toindex a number of data items is shown in FIG. 17. In the illustratedembodiment, unbalanced index 200 (or simply, index 200) includes anumber of nodes 210 arranged in a hierarchical fashion to index a numberof string values beginning with the prefix “al”. For example, theindexed values may correspond to keys 146 of various entries 144 of akeymap instance 140. Each node 210 within index 200 includes anassociated tag value that may or may not directly correspond to a dataitem being indexed. In the illustrated embodiment, nodes depicted asovals may correspond to interior nodes of index 200 that do not havecorresponding data items, while nodes depicted as rectangles maycorrespond to indexed data items. Thus, for example, node 210 acorresponds to the string “al” and is related to a number of other nodeswithin index 200, but there may not exist an actual key 146corresponding to the string “al”. By contrast, node 210 n having the tag“alicia” may correspond to a key 146 specifying the same string. Thedistinction between interior and non-interior nodes 210 may or may notbe explicitly reflected in the state of a node 210.

As described below, in some embodiments an unbalanced data structure maybe configured as an index of other indexes. In some such embodiments, adata item indexed within a first instance of index 200 may be a rootnode 210 of another index 200, and the corresponding node 210 within thefirst index 200 may be considered a non-interior node. That is, in someembodiments a non-interior node 210 of a given index 200 may begenerally defined as any node 210 associated with a data value, such asan entry 144 or a root node of another index 200, which is external tothe given index 200. Similarly, an interior node of a given index 200may reference only other nodes 210 within the given index 200 and maynot bear any association with an entry 144 or other index 200 distinctfrom the given index 200. It is also noted that, as shown in FIG. 17,non-interior nodes 210 are not necessarily leaf nodes (e.g., nodes thatdo not reference other nodes at lower hierarchical levels).

In various embodiments, each node 210 may encode a variety ofinformation. One embodiment of a generic node 210 illustrating variousdata fields that may be encoded within the node is shown in FIG. 18. Inthe illustrated embodiment, node 210 includes a tag field 212, a countfield 214, a fingerprint field 216, and one or more pointer fields 218.Generally, tag 212 may be configured to store a value corresponding to agiven node 210 that may be used in the course of traversing ormanipulating index 200, as described in greater detail below. In someembodiments, tag 212 may uniquely identify a node 210 among all nodeswithin index 200. Also, in some embodiments, a tag 212 of a given node210 may include as prefixes the tags 212 of all direct ancestors of thegiven node 210 within index 200. That is, a tag 212 of any given node210 may be determined through appending some value to the tag of thatgiven node's immediate parent node 210. For example, consider node 210 nof FIG. 17, which has the tag “alicia”. Each of node 210 n's directancestor nodes 2101, 210 k and 210 a has a tag (“alic”, “ali” and “al”,respectively) that forms a proper prefix of the tag of node 210 n.

As shown in FIG. 17, certain nodes 210 refer to one or more child ordescendant nodes 210 farther below in the hierarchy of index 200. In oneembodiment, pointer field(s) 218 may be configured to store datareflecting pointers or references from a given node 210 to another node210. For example, a given pointer field 218 may include an address thatidentifies a location of the referenced node 210 within an addressspace, such as a memory address space. The given pointer field 218 mayalso include additional tag information regarding the referenced node210. For example, as shown in FIG. 17, each arc from a given node 210 toa descendant node 210 is labeled with the first character of the tag 212of the descendant node 210 that differs from the prefix formed by thetag 212 of the given node 210. In one embodiment, this additional taginformation may be stored within a corresponding pointer field 218 alongwith a pointer to the referenced node 210. For example, the pointerfields 218 included in node 210 a may respectively include references tonodes 210 b, 210 g, 210 j, 210 k and 210 t, as well as corresponding tagdata “a”, “e”, “f”, “i” and “z”.

As discussed above with respect to FIG. 12, an index such as index 200may be used to organize data items such as keymap entries 144 forselection. In some embodiments, the pointer fields 218 of a non-interiornode 210 (that is, a node 210 that maps directly to a data item beingindexed) may also include a pointer to a corresponding data item, suchas a keymap entry 144, a block 425, or a brick 415. In some embodiments,as described in greater detail below, unbalanced indexes such as index200 may be implemented hierarchically, such that a non-interior node 210of one index 200 may refer to another index 200. A pointer field 218that references an indexed data item may be distinguished from a pointerfield 218 that references another node 210 via any suitable technique,such as by using distinct encodings for the different types of pointerfields 218. For example, in embodiments where tag information associatedwith arcs to descendant nodes 210 is encoded within pointer fields 218as described in the previous paragraph, a null tag may be used todistinguish a reference to an indexed data item from references todescendant nodes 210.

For a given node 210, count field 214 and fingerprint field 216 may beconfigured to reflect the state of nodes 210 beneath the given node 210.In one embodiment, count 214 may be configured to store the count of allnodes that are descendants of (e.g., are hierarchically beneath) thegiven node 210. For example, node 210 k of FIG. 17 has eight other nodes210 beneath it within index 200. Correspondingly, its count 214 mayindicate a value of 8 using any suitable encoding or format.

In various embodiments, fingerprint field 216 of a given node 210 may beconfigured to store a value indicative of a hash (e.g., the result of asuitable hash algorithm) performed on some portion of the data of thenodes 210 hierarchically beneath the given node 210. For example,fingerprint field 216 of a given node 210 may reflect the sum of thehashes of the tags 212 of all nodes 210 that are descendants of thegiven node 210. Alternatively, fingerprint field 216 may reflect thehash of the concatenation of tags 212 of descendant nodes 210 accordingto a particular, consistent order of traversal (e.g., breadth-first ordepth-first traversal). In other embodiments, other fields of a node 210besides tag 212 may participate in hashing. In some embodiments, thedata associated with a given node 210 may be reflected within its ownfingerprint field 216, whereas in other embodiments a fingerprint field216 of given node 210 may be determined strictly on the basis of itsdescendant nodes. For consistency of description, as used herein afingerprint of a given node 210 may refer to a hash value that is afunction of at least some descendant nodes of the given node 210, whilea hash of given node 210 may refer to a hash value that is a function ofdata associated only with given node 210 and not its descendants.

Generally speaking, a hash algorithm may be configured to map a givensource data value of possibly arbitrary length onto a smaller, typicallyfixed-length hash value such that if two hash values differ, theoriginal source data values from which the two hash values weregenerated must also differ in some way. As hash algorithms are typicallynot one-to-one functions, identity between two hash values does notnecessarily imply identity between original source data values. However,for some classes of hash algorithms, identity between original sourcedata values given identical hash values may be statistically likely towithin a quantifiable probability or degree of confidence, particularlyfor source data values that exhibit some degree of redundancy. Differenttypes of hash algorithms may also be referred to as signature,fingerprint or checksum algorithms. It is contemplated that any suitabletype of hash algorithm may be employed to generate a hash value to bestored in fingerprint fields 216, including, by way of non-limitingexample, any suitable version of the Message Digest 5 (MD5) algorithm orthe Secure Hash Algorithm (SHA), such as SHA-1, SHA-256, SHA-512, etc.

As described in the previous section, basic operations that may beperformed on a keymap instance 140 may include put and get operationsthat may respectively store and retrieve an entry 144 that correspondsto a key specified as a parameter to the operation. In some embodiments,various indexes within keymap instances 140 may be implemented asunbalanced indexes such as index 200.

Where large numbers of data items need to be indexed, as may be commonin keymap instances 140, it may be impractical to use a single instanceof index 200 for all the data items. For example, a single large indexmay not completely fit into the memory of a system processing the index,which may negatively affect the performance of operations that depend onthe index. In some embodiments, a large index may be implemented using astratified, unbalanced data structure, or stratified index. Generallyspeaking, in a stratified index, multiple instances of index 200 may behierarchically defined, where instances higher in the hierarchy mayindex other indexes 200, and indexes lower in the hierarchy may indexparticular entries 144 or other entities (e.g., blocks 425 or bricks415).

One embodiment of a stratified index is illustrated in FIG. 19. In theillustrated embodiment, stratified index 220 includes five indexes 200a-e. Index 200 a includes nodes 210 u-x, each of which is a non-interiornode that references a respective root node of one of indexes 200 b-e.In turn, indexes 200 b-e each include various ones of nodes 210 a-t thatwere shown in FIG. 17. In some embodiments of stratified indexes 220,higher-level indexes such as index 200 a may be configured to reside inthe memory, cache or another higher level of a memory hierarchy of asystem processing the index, while lower-level indexes such as indexes200 b-e may primarily reside in disk or another lower level of such amemory hierarchy. In such embodiments, lower-level indexes may berelocated from lower levels to higher levels of the memory hierarchy asneeded, for example using paging-type techniques. By supportinghierarchical partitioning of indexes of large numbers of data items,stratified indexes 220 may more efficiently and effectively use systemresources.

For example, using the aforementioned paging techniques, frequently usedindexes 200 of stratified index 220 may be kept in higher levels of amemory hierarchy, which are typically faster to access but limited incapacity, while less frequently used indexes 200 may be stored in lowermemory hierarchy levels, which are typically slower to access but havegreater storage capacity than higher levels. It is contemplated that insome embodiments, as nodes 210 are added to indexes 200 withinstratified index 220, individual indexes 200 may grow beyond a targetsize (such as the size of a disk block or memory page on the systemimplementing the indexes). In such embodiments, if a given index 200grows to exceed the target size, it may be split into two or more indexinstances. In the course of performing such a split, nodes 210 may beadded to a higher-level index 200 as necessary to account for the newindex instances.

In response to a keymap entry put or get operation, stratified ornon-stratified unbalanced indexes may be traversed to determine whetherthe specified key corresponds to a node 210 within the index 200. Oneembodiment of a method of unbalanced index traversal is illustrated inFIG. 20. In the illustrated embodiment, operation begins in block 2000where the key value to be searched (also referred to as the searchvalue) within the index is specified, for example via a relevant keymapoperation. Subsequently, the root node 210 of the index (e.g., the node210 having no parent node) is selected (block 2002).

For the selected node 210, the node's corresponding tag value 212 iscompared against the search value to determine whether the tag valuematches the search value exactly, is a prefix of the search value, orneither (block 2004). If the tag value 212 of the selected node 210matches the search value, then the selected node 210 is examined todetermine whether it is an interior or non-interior node (blocks2006-2008). For example, the pointers 218 or other content of theselected node 210 may be examined to determine if the node references adata value indexed by index 200, such as an entry 144 or anotherinstance of an index 200. If the selected node 210 is an interior node,an index miss may occur as described below (block 2022).

If the selected node 210 is a non-interior node, the data valuereferenced by the selected node 210 is retrieved (block 2010). Inembodiments that support stratified unbalanced data structures, wheresome data structure instances may index other data structure instances,the retrieved data value may either correspond to an entry 144 or a rootnode of another instance of index 200. If the retrieved data value is anentry 144, index traversal may be complete and the retrieved entry 144may be processed according to the keymap operation that initiatedtraversal (blocks 2012-2014). For example, if the initiating keymapoperation was a get operation, the retrieved entry 144 may be returnedas a result of the get operation. If the initiating keymap operation wasa put operation, the retrieved entry 144 may be modified according tothe parameters specified in the put operation.

If the retrieved data value does not correspond to an entry 144, then inthe illustrated embodiment, it may correspond to a root node 210 ofanother index 200. Correspondingly, this root node 210 may be selected(blocks 2012, 2016) and operation may proceed from block 2004 wheretraversal of the newly selected index 200 may proceed. Thus, in oneembodiment, execution of the method of FIG. 20 may proceed until thepresence or absence of a node 210 corresponding to the search value isdefinitively determined.

Returning to block 2006, if the tag 212 of the selected node 210 doesnot match the search value but is a prefix of the search value, thendescendants of the selected node 210 may be examined to determine if anydescendant corresponds to the search value (block 2018). If so, thecorresponding descendant node 210 may be selected (block 2020), andoperation may proceed from block 2004. In one embodiment, the pointer(s)218 of the selected node 210 may be examined to determine whetheradditional tag information associated with a particular pointer 218,when taken in conjunction with tag 212 of the selected node 210, alsoforms a prefix of (or entirely matches) the search value. For example,referring to FIG. 17, the tag “al” of node 210 a may be determined to bea prefix of a search value of “alibaba”. Additionally, the arc from node210 a to node 210 k, which may be represented by a corresponding pointer218, is associated with the additional tag information “i”. This taginformation, when appended to the tag “al” of node 210 a, forms thevalue “ali”, which is also a prefix of the search value. Therefore, node210 k may be selected for further traversal.

Returning to block 2018, if no descendant of the selected node 210corresponds to the search value, the search value does not have acorresponding entry 144 within the index 200, which may also be referredto as an index miss (block 2022). The index miss may then be processedaccording to the type of keymap operation that initiated the indextraversal (block 2024). For example, a keymap entry get operation mayprocess an index miss by returning an appropriate status indicationindicative of the miss to the requesting client. In contrast, a keymapentry put operation may process an index miss by inserting a new node210 corresponding to the entry 144 to be stored in the index as adescendant of the selected node 210. For example, the new node 210 maybe created and its various fields appropriately set for the entry 144 tobe stored, and a pointer 218 to the new node 210 may be stored withinthe selected node 210. It is noted that if a new node 210 is added to anindex 200 or an existing node 210 is modified, the count fields 214 andfingerprint fields 216 of all ancestor nodes 210 of the added ormodified node 210 may be updated to reflect the change.

Returning to block 2006, if the tag 212 of the selected node 210 doesnot match the search value and is not a prefix of the search value, thenan index miss may also occur, and processing may continue from block2022. In some instances, this case may occur when the selected node 210is the root node of an index 200. Correspondingly, in one embodiment,adding a new node 210 to the index 200 in response to this miss case mayinclude creating a new root node 210 having a tag 212 that is a commonprefix of both the search value and the tag 212 of the existing rootnode 210 (in this case, the selected node 210). (In some instances, thecommon prefix of the new root node 210 may be null, which may beinterpreted as a valid prefix for any value.) The new root node 210 maythen be configured to refer to the selected node 210 as a descendant. Ifnecessary, an additional node 210 may be created to correspond to thesearch value and configured as an additional descendant of the new rootnode 210.

It is noted that in some embodiments, an index miss may not immediatelyoccur while traversing stratified unbalanced indexes 200 if the tag 212of the selected node 210 does not match the search value and is not aprefix of the search value. In one embodiment, if this case isencountered, then if selected node 210 has a parent, the parent node 210is selected. If the parent node 210 is a non-interior node thatreferences another index 200, the root node 210 of the referenced index200 may be selected and processing may continue from block 2004.Otherwise, an index miss may occur. (It is noted, however, that thiscase may not arise in non-stratified, self-contained indexes 200 that donot index other indexes 200.) As an example of this case, consider thestratified index of FIG. 19 in which the search value is “alice”.Traversal of index 200 a may proceed to node 210 w having tag “ali”.Since node 210 w has a pointer to descendant node 210 x with associatedtag information “c”, which together with “ali” forms a prefix of thesearch value, node 210 x may be selected. However, the tag of node 210 xis “alicia”, which does not match and is not a prefix of the searchvalue. Thus, traversal may return to node 210 w (the parent of node 210x), which is a non-interior node that references index 200 c.Correspondingly, traversal may continue to node 210 k and ultimately tonode 210 m, which has a tag 212 that matches the search value.

In various embodiments, unbalanced indexes 200 or stratified unbalancedindexes 220 may be used to index keymap entries 144 within keymapinstances 140. For example, stratified indexes 220 may be employed toimplement one or more of partition index 410, block index 420 or entryindex 430, or any other levels of indexing that might be implementedwithin keymap instances 140. As discussed above, different keymapinstances 140 may be divergent or inconsistent in the ordinary course ofoperation when a relaxed synchronization protocol is employed. In someembodiments, keymap instances 140 may be synchronized using exhaustiveprotocols that traverse each node of the respective index datastructures in a consistent order (e.g., a depth-first or breadth-firstsearch order) to identify discrepancies in index structure or indexedcontent. However, various features of the unbalanced indexes describedabove, such as the distribution of data according to key informationrather than numbers of keys and the inclusion of count and/or cumulativehash information within the index data structure, may facilitate theimplementation of more computationally efficient synchronizationalgorithms.

Numerous possible versions of the anti-entropy set reconciliationprotocol described previously are contemplated for use with unbalanced,possibly stratified indexes implemented by keymap instances 140. Adescription of one embodiment of such a protocol follows, although it isunderstood that contemplated variations on the general protocol mayexhibit different implementation priorities, for example in choosing tooptimize certain cases over other cases or to use one or anotherparticular type or class of algorithm to perform a general step of theprotocol. Thus, it is intended that the described embodiment be regardedas illustrative rather than limiting.

In one embodiment, an anti-entropy protocol configured to reconciledifferent instances of an unbalanced index 200 or a stratifiedunbalanced index 220 may include the exchange between instances ofvarious types of messages. An exemplary set of messages upon which oneembodiment of the anti-entropy protocol may be based may include a DATAmessage, a REQUEST message, a HASH message, a FILTER message, and aFINGERPRINT message. The general function of respective embodiments ofeach of these messages is described below, followed by a discussion ofhow the messages may be used to implement an embodiment of theanti-entropy protocol. In the following discussion, reference may bemade to exchange of data among keymap instances 140, although it isunderstood that such keymap instances may implement one or moreinstances of unbalanced indexes 200 or stratified unbalanced indexes 220that include any of the features described above.

The DATA message may be used to convey data about one or more indexnodes 210 from one keymap instance 140 to another. In one embodiment,the DATA message may be configured to convey only the tag 212 associatedwith a given node 210, while in other embodiments the DATA message mayconvey other fields associated with given node 210. In some embodiments,if a given node 210 is a non-internal node, the DATA message may alsoinclude all or some portion of the data item associated with the givennode 210 (e.g., an entry 144 or information about a root node 210 ofanother index 200).

The HASH message may be used to convey information about one or moreindex nodes 210 from one keymap instance 140 to another, withoutexplicitly conveying the fields of a given node 210 or a data itemassociated with a given node 210. In one embodiment, the HASH messagemay be configured to convey a tag 212 associated with a given node 210as well as a hash of the given node 210 computed according to a suitablehash algorithm. In some embodiments, the hash of the given node 210 mayalso reflect a data item (e.g., a keymap entry 144) associated with thegiven node 210, but may exclude any descendants of given node 210.

The REQUEST message may be used to convey a request for informationassociated with one or more nodes 210. In one embodiment, the REQUESTmessage may be configured to convey one or more tag prefix values. Inresponse, the requesting instance may expect to receive informationabout those nodes 210 having tags 212 for which the conveyed tag prefixvalue is in fact a prefix. For a given node 210, the receivedinformation may include the contents of the corresponding fields of thegiven node 210 and/or the data item (e.g., a keymap entry 144)corresponding to the given node 210. In some embodiments, the REQUESTmessage may support further qualification of the requested tag prefixvalues, such as by specifying that a value or range of values within theresult space defined by a particular tag prefix value should be excludedfrom the results returned for that tag prefix value. For example, aREQUEST message may specify that information about all nodes 210matching the tag prefix value “alex” should be returned, except forthose nodes 210 that match the prefixes “alexe” or alexj”.

The messages just described may generally operate at the level ofgranularity of individual nodes 210. However, if the differences betweenkeymap instances 140 are generally small (e.g., confined to a minorityof nodes 210), it may facilitate the synchronization process to quicklyascertain the status of multiple nodes 210 at once. In one embodiment,the FINGERPRINT and FILTER messages may be configured to communicateinformation about aggregations of nodes 210. Specifically, in oneembodiment the FINGERPRINT message may be configured to convey thefingerprint field 216 of a node 210 along with its tag 212 from onekeymap instance 140 to another. As described above, the fingerprintfield 216 of a given node 210 may be configured to store a hash valuethat is determined as a function of the descendants of the given node210. Thus, if the fingerprint fields 216 of respective nodes 210 indifferent keymap instances 140 are equal, it may be highly probable(depending upon the characteristics of the hash algorithm used) that thearrangement and content of the descendants of the respective nodes 210are the same. That is, it may be highly probable that the portions ofthe keymap instances 140 descending from respective nodes 210 aresynchronized.

The use of fingerprints may allow a quick determination as to whetherportions of keymap instances 140 including substantial numbers of nodes210 are synchronized or not. However, fingerprints indicating thatcorresponding portions are not synchronized generally may not providefurther detail regarding how the portions differ. In one embodiment, aFILTER message may be configured to convey a filter value that encodes anumber of nodes 210 corresponding to a particular prefix value from afirst keymap instance 140 to a second keymap instance 140. The secondinstance may then use the received filter value to test its own nodes210 that correspond to the prefix value, to ascertain which nodes 210 ofthe second instance are not present in the first instance, if any.

In one embodiment, the filter value conveyed by the FILTER message maybe a Bloom filter, although it is contemplated that any suitablefiltering technique for recoverably encoding a set of data values into afilter value may be employed. Generally speaking, a Bloom filter of aset of values (e.g., nodes 210) may correspond to an M-bit binary value,where M is an integer. Before any values are encoded into a Bloomfilter, its initial value may be zero. That is, all bits of the filtermay be in a deasserted state. A Bloom filter may be populated by passingeach value to be encoded within the filter through each of a set of kindependent hash functions, each of which maps the value to be encodedonto a value in the range [0, M−1]. For each of the k resulting hashvalues, a corresponding bit within the Bloom filter is asserted (e.g.,set to a logical 1 value). M and k may be selected as design parametersaccording to the number and type of values to be encoded within theBloom filter, as well as the desired probability of false positives(discussed below). For example, in a 1,024-bit Bloom filter using eighthash functions, each hash function may produce a corresponding 10-bithash value specifying a particular one of the 1,024 bits of the filterto be asserted.

To test whether a given value has been encoded into a Bloom filter, thevalue is passed through the same set of k independent hash functionsused to encode the filter, and the resulting k bits of the filter valueare examined. If any of the resulting k bits of the filter are notasserted, the test value is definitely not encoded in the filter. If allof the resulting k bits of the filter are asserted, the test value mayor may not be encoded in the filter. That is, the test value may havebeen originally encoded in the filter, or it may be a false positive. Insome embodiments, the hash functions may be parameterized with a salt orseed value that is randomly or spontaneously generated (e.g., as afunction of the current system time) on each separate occasion a Bloomfilter is generated, to reduce the probability that the same falsepositive values will be generated when a given set of values issuccessively encoded into a filter.

Thus, for example, a first keymap instance 140 may encode a set of nodes{A, B, C, D, E} corresponding to a prefix P into a Bloom filter and mayconvey the filter to a second keymap instance 140 using a FILTERmessage. In the second keymap instance 140, a set of nodes {A, B, X, Y,Z} may correspond to prefix P. The second keymap instance 140 may testeach of the nodes against the filter and may determine that nodes A, Band X may be encoded in the filter, while nodes Y and Z are definitelynot encoded in the filter. Thus, the second keymap instance 140 maycorrectly conclude that nodes Y and Z are not present in the firstkeymap instance 140, and may conclude that nodes A, B and X are probablypresent in the first keymap instance 140, where X is a false positive.As a result, the second keymap instance 140 may take action to conveyinformation about nodes Y and Z to the first keymap instance 140.

It is contemplated that the DATA, HASH, REQUEST, FINGERPRINT and FILTERmessages may be implemented and conveyed according to any suitableprotocol or API, and may include various types of fields or parametersconfigured to convey the information described above as well as anyadditional information necessary to decode and properly process themessage. In one embodiment, messages may include additional parametersthat indicate whether, for a given tag value included in the message,the sending keymap instance either has corresponding data or needscorresponding data, respectively referred to as the got-data andneed-data parameters. For example, if a keymap instance 140 sends aFINGERPRINT message for a node 210 that has the tag “al” and some numberof descendants, the instance may include a got-data parameter indicatingthat the instance has some nodes 210 within the prefix space defined by“al”. The instance may also include a need-data parameter, for exampleif its copy of the prefix space defined by “al” is believed to beincomplete. In some embodiments, the got-data parameter may be implicitin the DATA and HASH messages, while the need-data parameter may beimplicit in the FILTER and REQUEST messages, although a DATA or HASHmessage may explicitly specify a need-data parameter while a FILTER orREQUEST message may explicitly specify a got-data parameter. In oneembodiment, a FILTER message may be required to specify at least one ofthe need-data or got-data parameters.

In one embodiment, an anti-entropy protocol conducted by two keymapinstances 140 may begin when the two instances establish contact withone another. Each instance may assume that it both has and lacks somedata. Correspondingly, each instance may send a FINGERPRINT message tothe other instance that specifies the tag 212 and fingerprint 216 of theroot node 210 of the instance and includes the got-data and need-dataparameters. For example, in an embodiment of keymap instance 140employing a stratified unbalanced index 220, the root node 210 maycorrespond to the node 210 having no parent node within the index 200that has no parent or superior index 200.

One embodiment of a method of processing a FINGERPRINT message isillustrated in FIG. 21. In the illustrated embodiment, operation beginsin block 2100 where a FINGERPRINT message is received from a messagesender. For example, a first keymap instance 140 may convey aFINGERPRINT message including a tag value, a fingerprint and one or moreof the got-data or need-data parameters to a second keymap instance 140.After a FINGERPRINT message is received, then the index(es) of themessage receiver are traversed to identify whether a node 210 exists forwhich the received tag value is a prefix of (or exactly matches) thecorresponding tag field 212 (block 2102). For example, the indexes of akeymap instance 140 may be traversed starting from the root node 210using the method of FIG. 20 or a suitable variant thereof.

If the received tag value is not a prefix or exact match of a tag field212 of any node 210, then a node 210 corresponding to the nodereferenced by the FINGERPRINT message may not exist at the messagereceiver. Correspondingly, the receiver may respond by conveying aREQUEST message to the message sender specifying the tag value includedin the originally received FINGERPRINT message (block 2104). In oneembodiment, processing of the REQUEST message may proceed as describedin greater detail below. In some embodiments, the REQUEST message may beconveyed only if the received FINGERPRINT message indicates the got-dataparameter.

It is noted that in some embodiments, completion of individual messagesexchanged during operation of the anti-entropy protocol may not dependon whether additional messages generated in response to a given messagesuccessfully complete. That is, in some embodiments, the processing ofindividual messages may occur in a stateless and asynchronous fashionwith respect to other messages. In discussion of the exemplaryembodiments described herein, this stateless, asynchronous model will beassumed. Thus, after the REQUEST message has been generated, processingof the FINGERPRINT message itself may be considered complete (block2106). However, this model is not essential to the general operation ofthe anti-entropy protocol, and it is contemplated that in alternativeembodiments, any given message may block, wait or otherwise maintainsynchronization with messages generated subordinately or in response tothe given message. For example, explicit handshaking, acknowledgement,retry or other types of protocols may be employed in some embodiments toconvey the state of completion of one message to another dependentmessage.

If the received tag value does correspond as a prefix or match of a tag212 of a particular node 210 at the message receiver, the receivedfingerprint value may be compared against the fingerprint field 216 ofthe particular node 210 to determine whether the two fingerprints match(block 2108). If so, then it may be highly probable (e.g., subject tothe probability of the fingerprint algorithm in use producing twofingerprints that collide, or have the same value, despite beinggenerated from different data) that the message sender and the messagereceiver are synchronized with respect to the received tag value. Forexample, it may be highly probable that any nodes 210 having thereceived tag value as a prefix are in the same state within the keymapinstance 140 from which the FINGERPRINT message was sent and the keymapinstance 140 at which the message was received. Thus, no additionalmessages may be generated in response to the FINGERPRINT message, andthe message may be considered complete (block 2106).

If the fingerprints do not match, then the message sender and messagereceiver are not synchronized with respect to the received tag value,and additional work may be needed to bring the sender and receivercloser together in state. As described above, the FILTER message may beuseful in allowing a sender to communicate specific information aboutcertain nodes 210 to a receiver. However, in some embodiments, thenumber of nodes 210 that may be encoded into the FILTER message whilepreserving a reasonable false-positive rate may be limited to a certainthreshold value. If the number of descendant nodes 210 exceeds thisthreshold at the message receiver node 210 that matches the received tagvalue, it may be more efficient to perform additional FINGERPRINTmessage processing before sending FILTER messages.

Thus, in the illustrated embodiment, if the fingerprints do not match,the count field of the particular node 210 at the message receiver maybe examined to determine if it exceeds the threshold value for FILTERmessage processing (block 2110). If so, the message receiver may beconfigured to subdivide its portion of the index range corresponding tothe received tag value according to the children of the particular node210 for which the received tag value is a prefix (block 2112). For eachchild node 210, the message receiver may be configured to send acorresponding FINGERPRINT message back to the original message sender,specifying the tag 212 and fingerprint field 216 of the respective childnode 210 (block 2114). Additionally, if there are gaps in the portion ofthe index range corresponding to the received tag value, for example asindicated by the children of the particular node 210, the messagereceiver may be configured to send one or more REQUEST messages for thetag values that correspond to the gaps (block 2116). Processing of thereceived FINGERPRINT message may then be considered complete (block2118). In one embodiment, in addition to the above actions, if thereceived tag prefix value is an exact match of the particular node 210,a HASH message corresponding to the particular node 210 may be returnedto the message sender.

For example, as shown in FIG. 17, a particular node 210 a of an index200 of a message receiver might have the tag “al” and children havingcorresponding tags “alan”, “alex”, “alfred”, “ali” and “alz”. Thissuggests that the message receiver has some information about nodes 210that begin with “alan” and “alex”, but not about nodes 210 that mightbegin with “alb”, “alc” or “ald”. Correspondingly, the message receivermay convey a FINGERPRINT message for each of the children of node 210 a,as well as REQUEST messages for gaps among the tags of these children.In embodiments where negative REQUEST syntax is supported, the messagereceiver may convey REQUEST messages for tags other than thosecorresponding to the children of the particular node. For example, themessage receiver may send REQUEST messages for tags other than thoseprefixed with “alan”, “alex”, “alfred”, “ali” and “alz”.

If the count value of the particular node 210 does not exceed thethreshold value for FILTER message processing, then if the receivedFINGERPRINT message includes the got-data parameter, the message sendermay have specific information about nodes 210 not present at the messagereceiver. Correspondingly, the message receiver may be configured tosend a FILTER message that encodes into a filter (e.g., a Bloom filteras described above) each node 210 that is a descendant of the particularnode 210 (blocks 2120-2122). For example, referring to FIG. 17, if theparticular node corresponds to node 210 l, then a Bloom filter encodingeach of nodes 210 m-q may be generated and returned via a FILTERmessage. In the illustrated embodiment, if the got-data parameter wasnot included in the original FINGERPRINT message, respective FINGERPRINTmessages may be generated and returned to the message sender for each ofthe children of the particular node 210, instead of the FILTER message(block 2124). These FINGERPRINT messages may include the got-dataparameter. Following either generation of FILTER or FINGERPRINT messagesin this case, processing of the received FINGERPRINT message may becomplete (block 2118).

One embodiment of a method of processing a FILTER message is illustratedin FIG. 22. In the illustrated embodiment, operation begins in block2200 where a FILTER message including a tag value and a filter value isreceived from a message sender, for example in response to a FINGERPRINTmessage as described above. Once the FILTER message is received, theindex(es) of the message receiver are traversed to identify theparticular node 210 that corresponds to the received tag value (e.g.,for which the received tag value is a prefix or match), in a mannersimilar to the described above with respect to FIG. 21 (block 2202). Insome embodiments, if a FILTER message is generated in response toanother message, a node 210 corresponding to the received tag value willgenerally exist.

The message receiver may then test each descendant of the particularnode 210 against the filter value provided in the FILTER message toidentify those nodes 210 that are not encoded in the filter value, ifany (block 2204). For each node 210 at the message receiver that is notencoded in the filter value, a corresponding DATA message may bereturned to the message sender (block 2206). Processing of the FILTERmessage may then be considered complete (block 2208). As noted above,depending on the type and configuration of the filter algorithm employedfor the FILTER message, false positives may occur. That is, the messagereceiver may falsely conclude that certain ones of its nodes 210 areencoded in the filter value, and thus are present in the same state atthe message sender, when in fact they are not. Thus, it is possible thata single round of the anti-entropy protocol may not result in two keymapinstances 140 becoming synchronized with respect to every node 210.However, it may be expected that in many embodiments, a single round ofthe anti-entropy protocol may not cause the instances to become moredivergent, and repeated applications of the protocol may be expected toconverge within a certain number of rounds with a certain degree ofprobability, depending on the degree to which the instances differ andthe characteristics of the filter algorithm used (e.g., the probabilityof false positives given the threshold value for filter encoding).

In some embodiments, processing of the HASH, REQUEST and DATA messagesmay be considerably simpler than the FILTER and FINGERPRINT messages. Inone embodiment, a HASH message receiver may attempt to identify a node210 corresponding to the tag value included in the message, and may thencompute a corresponding hash value of the identified node 210. If thereceived hash value matches the computed hash value, the identified node210 may already be synchronized with a corresponding node 210 at themessage sender. Otherwise, a REQUEST message including the received tagvalue is returned to the message sender to obtain a more current dataversion.

Processing of a REQUEST message, in one embodiment, may simply includethe message receiver identifying each node 210 for which the receivedtag value included in the message matches or is a prefix of thecorresponding tag field 212, for example using the unbalanced indexnavigation techniques described above. For each identified node 210, acorresponding DATA message, configured as described above, is returnedto the message sender. In one embodiment, processing of a received DATAmessage may include identifying whether a node 210 corresponding to thetag value indicated in the message exists at the message receiver. Ifnot, a corresponding node 210 may be created and populated with dataextracted from the message. If so, the data associated with the existingnode 210 and/or its corresponding data value may be replaced with dataextracted from the message. In some embodiments, data of an existingnode 210 may only be replaced if the received data is more current. Forexample, a DATA message may include the contents of an entry 144corresponding to a node 210 at the message sender, and entry 144 mayinclude timestamp information that may be compared with correspondingtimestamp information at the message receiver to ascertain whether thereceived entry 144 is more current than the existing entry 144. If so,the received entry 144 may replace the existing entry 144.

Variations of the general synchronization protocol of FIG. 21 arepossible and contemplated. For example, in embodiments in whichcommunication between keymap instances is performed using packets havinga fixed length, bandwidth utilization may be improved by conveyingmultiple FINGERPRINT messages for multiple nodes 210 within a singlepacket, rather than a single FINGERPRINT message corresponding to aparticular node 210. An instance receiving such a packet may then beable to rapidly discern which particular ones of its index(es) 200mismatch with the sender without necessarily exchanging further messageswith the sender. For example, if the first FINGERPRINT message does notmatch, the receiver may consider other FINGERPRINT messages within thepacket prior to issuing a REQUEST, FILTER or other message to the packetsender. In so doing, the receiver may be able to narrow the discrepancyto a particular portion of the data structure, which may reduceunnecessary network traffic to exchange messages regarding otherportions of the data structure that are already synchronized.

In general, it is contemplated that any of the methods or techniquesdescribed above for performing keymap instance reconciliation using ananti-entropy protocol and/or an update propagation protocol may beimplemented by a keymap coordinator process configured to operate at thelevel of keymap instances 140 or individual hosts 400 within instances.It is noted that numerous variations of the aforementioned methods andtechniques for implementing anti-entropy protocols for unbalanced datastructures are possible and contemplated, and the above discussion isintended to be illustrative rather than limiting. For example, thegeneral class of protocols via which some entities frequentlycommunicate with other, randomly selected entities in order todistribute information throughout a network may be referred to asgossip-based protocols, and other techniques or aspects of gossip-basedprotocols may be employed for use in an anti-entropy protocol amongkeymap instances 140. In various embodiments, the examplesynchronization messages described above (or other suitable messages)may be combined in different ways to yield synchronization protocolshaving different characteristics.

Additionally, while the stratified indexed data structure andsynchronization techniques described above with respect to FIGS. 17-22have been discussed in the context of implementing efficient datastructures for use within keymap instances 140, it is contemplated thatsuch data structures and synchronization techniques may be employed inany application in which large quantities of data may be indexed forrapid access. Such applications need not necessarily include objectstorage systems such as the system of FIG. 2, but may include databasesystems, search systems, or any other applications where data indexingmay be applicable.

It is noted that in various embodiments, implementation of any type ofrandom generation or selection of events described herein may employ anysuitable algorithm or technique for random number or event generation.In many cases, computational techniques for implementing random methodsmay not produce purely random results, but rather pseudorandom results.For example, pseudorandom algorithms may specify deterministic processesconfigured to generate statistically random results. As used herein, thegeneration of “random” or “substantially random” data is intended toinclude any suitable pseudorandom computational techniques as well aspurely random data sources.

Storage Service Component Detection and Management

In a large-scale, highly distributed implementation of a storage servicesystem, there may be large numbers of the various system componentsshown in FIG. 2 distributed throughout the system. For example, therecould be hundreds or thousands of instances of bitstore nodes 160,coordinators 120 and keymap instances 140. Managing the state of adistributed system of such scale presents practical challenges. Forexample, different instances of particular system components may be outof service at any given time owing to planned maintenance, failure ofcomputing resources relied upon by components, communication failuresthat isolate otherwise-functional components, or for other reasons.Additionally, new or previously out-of-service instances of componentsmay return to service, in some cases at arbitrary or unpredictabletimes.

In one embodiment, instances of discovery, failure and detection daemon(DFDD) 110 may be configured to respectively monitor the state ofvarious associated components of the storage service system, tocommunicate with one another regarding such state, and to provide DFDDclient applications with an interface through which such clients mayidentify available system components that may be used to perform systemoperations, such as keymap or bitstore operations. Generally, DFDD 110may be configured to provide a uniformly accessible view of the currentstate of storage service system components on behalf of othercomponents. That is, rather than configuring various components of thestorage service system with multiple different interfaces configured fordirect communication of state information with other, dissimilarcomponents, each component that provides or depends on such informationmay be configured to communicate with an instance of DFDD 110 via astandard DFDD interface. In some embodiments, DFDD 110 may beimplemented as a daemon process configured to operate within anenvironment managed by an operating system. However, in otherembodiments DFDD 110 may be implemented as an independent or autonomoushardware or software agent configured to implement the functionalitydescribed herein, without any necessary dependence on or subservience toan operating system or other components.

Generally speaking, each instance of a storage service system componentthat is configured to be discovered and monitored by an instance of DFDD110 may be referred to as an application instance. For example, theoperational state or health of a given bitstore node 160 may beindicated by an instance of SNM controller 161 that is configured forexecution by the given bitstore node 160. Thus, SNM controller 161 maycorrespond to a bitstore application instance. Similarly, theoperational state of a keymap instance 140 may be indicated by instancesof a keymap manager configured for execution on one or more hosts 400within the keymap instance. Each keymap manager instance may correspondto a keymap application instance. Other types of application instancesare possible and contemplated. For example, in one embodiment, eachcomputer system via which one or more storage service system componentsare deployed may include a host monitor application instance configuredto detect and report system-specific operational state details, such asutilization of processor, memory, disk, input/output (I/O) or othersystem resources. In some embodiments, each instance of DFDD 110 mayitself be configured as an application instance. That is, DFDD instancesmay be configured to monitor their own operational state in addition tothe state of other application instances.

Within a storage service system, application instances may begenerically identified by application names and uniquely identified byrespective application instance identifiers (IDs). For example, aparticular application name may include a string that identifies ageneric type of application instance, such as “keymap-manager”,“bitstore-manager”, “host-manager” or another suitable name, while anapplication instance ID may include a string that uniquely identifies aparticular instance within the application name space. In someembodiments, the application instance ID may explicitly include theapplication name, such as “keymap-manager-4AB8D945”. Other suitableformats for application instance IDs may also be employed. In oneembodiment, a given instance of DFDD 110 may be configured to associatea number of application instances (e.g., via names and instance IDs)with respective state information. For example, in the embodiment shownin FIG. 23, DFDD 110 includes a number of entries 111, each of which mayassociate an application name 112 and instance ID 113 with instancestate information 114. In some embodiments, DFDD 110 may employ one ormore tables to reflect the association of different types of stateinformation 114 with a given application name 112 and instance ID 113,while in other embodiments, DFDD 110 may employ trees, unbalancedindexes such as described above, or any other suitable types of datastructures indicative of the association between a given applicationinstance and its corresponding state information.

It is noted that in some embodiments, application instance IDs mayinclude their own name spaces of arbitrary levels of granularity. Forexample, in one embodiment, a given keymap application instance ID maybe of the form <mapname>/<instance>/<endpoint>. The term <mapname> mayidentify a specific keymap dictionary of key-entry associations, whichmay generally correspond to a given keymap deployment. (It is possiblefor keymap application instances for different keymap deployments to bemanaged within the same instance of DFDD 110.) The term <instance> mayidentify a specific host 400 within a keymap instance 140, for exampleby a unique string. The term <endpoint> may identify one of a number ofindependent, functionally identical keymap application instancesoperating on the identified host 400 (e.g., as distinct processes).Other complex name spaces within application instance IDs are possibleand contemplated.

The state information 114 associated with an application instance byDFDD 110 may include a variety of different types of information. In oneembodiment, DFDD 110 may be configured to store within state information114 global operational state information that may be common to all typesof application instances managed by DFDD 110. For example, as describedin greater detail below, in some embodiments DFDD 110 may implement aglobal operational state machine that defines a set of globaloperational states (or simply, global states) of application instancesas well as possible transitions among the set of states. In suchembodiments, each application instance managed by DFDD 110 may beassociated with a specific one of the set of global states at any giventime, and the global state for a given application instance may changeover time according to the state machine and the behavior of theapplication instance.

In addition to global state information, which may be common to widelydifferent types of application instances, in some embodiments stateinformation 114 may reflect operating state information that may bespecific to or customized for a particular application instance or typeof instance. For example, if an application instance corresponds to abitstore manager of a particular bitstore node 160, its stateinformation 114 may include information about the quantity of availablestorage resources on that particular node, the type of those resources(e.g., high performance, low performance, etc.) or any other relevantstate information that may be specific to the context of a bitstorenode. Similarly, for an application instance corresponding to a keymapmanager of a particular keymap instance 140, its state information mayinclude information about the number of entries 144 managed by theparticular keymap instance, keymap storage resources used or available,or other relevant keymap state information. In some embodiments, theselection of what application instance-specific state information toinclude within a corresponding DFDD entry 111 may be determinedaccording to the requirements of DFDD clients. For example, stateinformation that may be useful in assisting a coordinator 120 ornodepicker 130 in selecting a particular bitstore or keymap applicationinstance from among several choices may be included within the DFDDentries 111 of those application instances.

In some embodiments, the state information 114 of an applicationinstance may also include information about how a DFDD client may accessthe instance. For example, state information 114 may include an InternetProtocol (IP) address and port number through which a DFDD client mayestablish a connection with the application instance. Some applicationinstances may support other types of interfaces such as web servicesinterfaces, publish/subscribe interfaces, or other suitable interfaces.In such embodiments, state information 114 may include a URL or otherinformation necessary for a DFDD client to perform a web services call,to subscribe to a publish/subscribe channel, or to perform another typeof action necessary to establish communication with the applicationinstance. In some embodiments, in addition to or instead of applicationinstance access information, state information 114 may includeinformation about where the instance is physically located within astorage service system. For example, state information 114 may includean identifier of a data center 300 or area 310 to which a particularapplication instance corresponds.

As mentioned above, in some embodiments DFDD 110 may maintain globalstate information for individual application instances that may indicatein general terms whether a given application instance is operatingnormally, and thus available for use, or is in an abnormal state. In oneembodiment, each application instance configured for monitoring by aninstance of DFDD 110 may be configured to report its status to DFDD 110,often (but not necessarily) at regular intervals such as some number ofseconds or minutes. Such a report may be referred to as a “heartbeat.”Heartbeat reports may be communicated according to any suitable protocol(e.g., as TCP/IP messages, as web services calls, or according to otherstandard or proprietary messaging protocols) and may vary in informationcontent. As a minimal example, a given application instance may submit aheartbeat to DFDD 110 that simply includes the application name andapplication instance ID corresponding to the given instance. In othercases, the given application instance may include additional statusinformation in the heartbeat, such as the specific state of localresource utilization. In some embodiments, application instances may beconfigured to perform some level of self-diagnosis or self-verificationto ascertain their own functional state before sending a heartbeat,while in other embodiments an application instance may send a heartbeatwithout dependence on any self-assessment.

Generally speaking, if an application instance is sending heartbeats toDFDD 110 as expected, there is a reasonable expectation that it isoperating normally. If heartbeats should be interrupted for some lengthof time, there is a reasonable expectation that something is wrong withthe application instance. FIG. 24 illustrates one embodiment of a globalstate machine that may be maintained by DFDD 110 for each applicationinstance as a function of heartbeat activity and/or other parameters. Inthe illustrated embodiment, a new application instance comes online inthe NEW state, for example shortly after it begins operation andnotifies an instance of DFDD 110 of its existence and provides anapplication name, application instance ID, and any other informationnecessary for DFDD 110 to initialize a corresponding entry 111. Once thenew application instance is stable and ready to begin normal operation,it enters the OK state. In various embodiments, transition from the NEWto the OK state may be a function of time (e.g., a default settling timebased on the type of the application instance), application instanceself-reporting, administrator intervention, or a combination of these orother factors.

In the illustrated embodiment, an application instance may remain in theOK state as long as the time elapsed since the instance's last heartbeatto DFDD 110 is less than a failure threshold T_(fail). For example, DFDD110 may maintain a counter for each application instance that isincremented upon each heartbeat received from the correspondinginstance, and may monitor each counter (e.g., with countdown timers) toascertain whether its value changes before T_(fail) elapses. In someembodiments, global states other than OK (and possibly NEW) may begenerically referred to as abnormal operating states or failure states,though there may be distinctions among such states as described below.

If time T_(fail) has elapsed since the last heartbeat for an applicationinstance, its global state may transition to INCOMMUNICADO. In theillustrated embodiment, INCOMMUNICADO may function as a transient stateindicative that something may be wrong with the application instance,but it has not been definitively determined to have permanently failed.For example, the application instance may have temporarily stalled orhung, the heartbeat message to DFDD 110 may have gotten delayed or lost,or as described in greater detail below, one instance of DFDD 110 may beout of synchronization with another instance of DFDD 110 with respect tothe current state of the application instance. If a heartbeat isreceived from an application instance in the INCOMMUNICADO state, theinstance may transition back to the OK state. In some embodiments, DFDDclients may elect at their own risk to use an application instance thatis in the INCOMMUNICADO state.

If an application instance does not spontaneously recover from theINCOMMUNICADO state, there may be a more serious problem affecting theinstance. In the illustrated embodiment, two possible failure scenariosmay occur. As shown by the FAIL state, an individual applicationinstance may fail in isolation, for example due to failure of underlyingcompute resources hosting the individual instance. Alternatively, anapplication instance may fail owing to a loss of network communicationbetween the instance and DFDD 110, as shown by the NETWORK SPLIT state.For example, an application instance may be operational and accessibleto some instances of DFDD 110 but not others, due to a communicationfailure that isolates portions of the storage service system from oneanother.

It may be difficult to determine with certainty whether a givenapplication instance failure is isolated or owing to a network split. Insome embodiments, DFDD 110 may employ respective heuristic criteriaH_(fail) and H_(netsplit) that take into account various types ofavailable information to make a determination as to whether anapplication instance should transition from the INCOMMUNICADO state tothe FAIL state or the NETWORK SPLIT state. For example, the criteria mayrequire that a given application instance be in the INCOMMUNICADO statefor at least a threshold amount of time T_(heuristic) beforetransitioning to another failure state. Additionally, the criteria maytake into account whether other application instances that shareresources with or belong to the same area 310 or datacenter 300 as thegiven application instance are also in an INCOMMUNICADO, FAIL or NETWORKSPLIT state. For example, if other application instances located at thesame IP address as the given application instance or at other addresseswithin the same area 310 or data center 300 are OK, it may be likelythat the failure of the given application instance is isolated. Bycontrast, if multiple application instances are not OK, a network splitscenario may be more likely, particularly if application instance statusis clustered according to geography or network topology. In someembodiments, DFDD 110 may be configured to interrogate applicationinstances suspected of failure, in addition to using passively receivedstatus information in order to determine the nature of the failure. Insome embodiments, the heuristic criteria may be configured to determinewhether an application instance is probabilistically likely to havefailed according to some threshold of probability (e.g., greater than50% probability, greater than 90% probability, etc.).

Depending on the heuristic criteria, a failed application instance maytransition to either the FAIL state or the NETWORK SPLIT state. In oneembodiment, the instance may transition back to the OK state from eitherof these states if a heartbeat is received, while in other embodimentseither or both of these states may be irrecoverable. While anapplication instance that is in the INCOMMUNICADO state may be presumedto be functional or recoverable with a possibility of failure,application instances in the FAIL or NETWORK SPLIT states may bepresumed to have failed (with a possibility of recovery in someembodiments). Generally, DFDD clients may avoid selecting thoseapplication instances in either of these failure states. In someembodiments DFDD 110 may be configured to conceal from clientsinformation about application instances in either of these failurestates.

In the illustrated embodiment, an application instance may remain ineither the FAIL or NETWORK SPLIT states for respective periods of timeT_(clean) and T_(recover) before passing to the FORGOTTEN state. Forexample, in some cases of the FAIL state, the resources associated withthe failed application instance may be preserved for some time forrecovery or analysis purposes. If possible, such resources (e.g., thestorage resources of a bitstore node 160) may then be initialized forredeployment as a new application instance. In some cases of the NETWORKSPLIT state, a decision may need to be made regarding whether to proceedwith system operation without the failed application instances, and ifso, what sort of recovery actions should be taken (e.g., regeneratingobject replicas among remaining application instances, etc.). In someembodiments, failed application instances may not pass to the FORGOTTENstate until such recovery actions are complete.

The FORGOTTEN state of an application instance may not be explicitlyrepresented within DFDD 110. Rather, in some embodiments it may bemarked by a deletion of existing state information of the applicationinstance, such as its DFDD entry 111, from DFDD 110. In general, anapplication instance may not recover from the FORGOTTEN state, althoughin some instances a new instance of the application may be initializedusing the same resources allocated to the forgotten instance via the NEWstate. In some embodiments, if an application instance shouldspontaneously resume sending heartbeats while in the FORGOTTEN state,DFDD 110 may recognize that the instance has been forgotten (e.g., nolonger corresponds to a valid entry 111) and may instruct the instanceto cease operating or to reset or reinitialize itself.

It is noted that in some embodiments, the heuristics and transition timeparameters that factor into global state transitions may be differentfor different types of application instances, and some or all of theseparameters may be adjustable by DFDD clients. Also, while a DFDD clientmay generally query an instance of DFDD 110 to ascertain the currentglobal state of a given application instance, in some embodiments DFDD110 may support a publish/subscribe state change notification model. Forexample, a DFDD client may inform DFDD 110 via a subscription processthat the client wishes to be notified of all or certain types of globalstate changes of a particular application instance or set of instances.Upon detecting such a state change, DFDD 110 may then convey a messageindicative of the change to subscribing DFDD clients.

Frequently, an application instance may be configured to send heartbeatinformation to an instance of DFDD 110 that is closest to theapplication instance. For example, in some embodiments an instance ofDFDD 110 may be provisioned on each computer system that is configuredto host one or more other application instances, so that applicationinstances may readily access a local instance of DFDD 110 simply byreferring to the local IP address of their host and using a well-knownIP port reserved for application instance-DFDD communication. However,if application instances report their status to some instances of DFDD110 and not others, then in the absence of some effort to synchronizetheir state, deployed instances of DFDD 110 may become divergent.

In some embodiments, divergence among instances of DFDD 110 may beaddressed using synchronization protocols similar to those describedabove with respect to keymap instances 140, such as gossip-basedprotocols. However, in many cases, the number of DFDD entries 111collectively managed by instances of DFDD 110 may be substantiallysmaller than the number of keymap entries 144 managed by keymap instance140. When this is the case, simpler reconciliation protocols may be usedto synchronize instances of DFDD 110. A method of operation of oneembodiment of such a gossip-based protocol is shown in FIG. 25. In theillustrated embodiment, operation begins in block 2500 where oneinstance of DFDD 110, referred to as the initiating instance, randomlyselects another, peer instance of DFDD 110 for synchronization. In someembodiments, the initiating DFDD instance may occasionally deliberatelyselect a peer DFDD instance from among those DFDD instances currently ina failed state (e.g., NETWORK SPLIT) according to the initiating DFDDinstance's state information. If the initiating DFDD instance succeedsin contacting and synchronizing with an apparently-failed peer instance,recovery from the apparent failure may be facilitated.

The initiating instance may then compute a hash value of the identifyinginformation of the application instances reflected in its entries 111(e.g., by hashing application instance names and IDs, and possiblyendpoints or other identifying information) (block 2502). The hash valuemay be determined according to any suitable hash algorithm, such as theMD5 algorithm, for example. The initiating instance then conveys thecomputed hash value to the peer instance along with a sorted list ofcurrent application instance state information (e.g., heartbeat counts,global state information and/or any other information included in stateinformation 114) (block 2504). The list of state information may besorted according to any criterion that produces a consistent list atboth the initiating and peer instances. For example, the list may besorted according to application instance name and/or ID.

It is noted that as described above, in some embodiments stateinformation associated with an application instance may be derived fromheartbeat count information included within a heartbeat message.Correspondingly, in some embodiments, DFDD instances may exchangeheartbeat count information for application instances and may deriveapplication instance state information from received heartbeat countinformation, rather than receive state information directly from otherDFDD instances. Thus, in one embodiment a given DFDD instance may beconfigured to update the state of a particular application instance(e.g., according to the state machine of FIG. 24) on the basis ofreceived heartbeat count information regardless of whether thatinformation was received directly from the particular applicationinstance, or indirectly from another DFDD instance via a synchronizationprotocol. In such an embodiment, synchronization of application instanceoperating state information among DFDD instances may involvesynchronization of heartbeat information without directly exchanging theparticular global operating state (e.g., OK, INCOMMUNICADO, etc.) of anapplication instance, which may simplify the operation of thesynchronization protocol.

In response to receiving the hash value and list of state information,the peer instance computes a hash value of the identifying informationof its own application instances, in a manner consistent with thatperformed by the initiating instance (block 2506), and compares theresulting hash value with the hash value received from the initiatinginstance (block 2508). If the two values agree, there is a highprobability that both the initiating and peer instances have entries 111that correspond to the same set of application instances. The peerinstance may then scan the received list of state information and updateits entries 111 from the received list as appropriate (block 2510). Forexample, if a heartbeat count or timestamp in the received list isgreater or more recent than that stored in one of the peer's entries111, the peer may update the entry 111 from the state information in thereceived list. In some embodiments, the peer instance may send its ownlist of state information back to the initiating instance for similarprocessing, either concurrently with or subsequent to receiving the listfrom the initiating instance.

If the hash values disagree, it is likely that the set of applicationinstances known to the peer and initiating instances differ in at leastone entry 111. Correspondingly, the peer instance may request a completedump of the entries 111 known to the initiating instance (as opposed tojust the state information 114 of those entries 111) (block 2512). Thepeer instance may then add any entries 111 it was lacking andsynchronize the state of the remaining entries 111 (block 2514). Asabove, in some embodiments the peer instance may send a complete dump ofits entries 111 back to the initiating instance, either concurrentlywith or subsequent to receiving the dump from the initiating instance.

It is contemplated that in some embodiments, every instance of DFDD 110present within a system may be configured to repeatedly execute thesynchronization protocol just described, or a suitable variant thereof,at intervals of time. For example, the protocol may be executed byinstances of DFDD 110 roughly periodically with a period of one second,or any other suitable period. It is further contemplated that in someembodiments, instances of DFDD 110 may execute the synchronizationprotocol with roughly the same periods but different phase offsetsrelative to one another, such that at any given time, only a portion ofinstances of DFDD 110 may commence the protocol.

It is noted that in some embodiments, instances of DFDD 110 may be usedto coordinate and communicate state information for any type ofapplication instances within any distributed system, not simply thoseapplication instances defined within a storage service system. Also, insome embodiments, different groups of DFDD instances may managedifferent application instance state information. In some suchembodiments, groups may be distinguished from one another by assigning acommon identifier to instances of DFDD 110 that are members of the samegroup and requiring identifiers to match as a condition of DFDDsynchronization. For example, DFDD instances that manage storage servicesystem application instances may have an identifier that is distinctfrom DFDD instances configured to manage the state of other applicationinstances unrelated to the storage service system, and only those DFDDinstances having the same identifier may exchange information with oneanother according to the synchronization protocol of FIG. 25.

In some embodiments, DFDD group identifiers may be used to distinguishdifferent configurations of application instances present in the samesystem. For example, one set of instances of DFDD 110 corresponding to a“production” identifier may be deployed to manage a production versionof a storage service system or another distributed system, and mayreflect one set of application instances corresponding to the productionsystem, while another set of instances of DFDD 110 corresponding to a“test” identifier may be deployed to manage a test version of the systemthat corresponds to a different set of application instances and state.It is noted that in some cases, application instances and/or DFDDinstances corresponding to either system version may execute on the sameunderlying system resources (e.g., on the same computer system), but maybe rendered transparent to one another by virtue of their distinct DFDDgroup identifiers. For example, when executing a synchronizationprotocol such as the protocol illustrated in FIG. 25, DFDD instances mayfirst determine whether they are members of the same group (e.g., byexchanging group identifiers) and performing the subsequentsynchronization steps contingent upon this determination, therebyfacilitating the segregation of application instance state informationbetween groups.

It is noted that the previously described gossip-based protocol forsynchronizing instances of DFDD 110 may not only aid in distributing theoperational states of existing application instances throughout astorage service system, but may facilitate the discovery of newapplication instances by other system components as well. For example,once a new application instance is initialized and makes contact with aninstance of DFDD 110 (e.g., an instance operating locally on the systemon which the new application instance was initialized), a new entry 111may be created corresponding to the new instance. As the instance ofDFDD 110 on which the new entry 111 was created synchronizes its statewith various other instances of DFDD 110, the new entry 111 may bepropagated throughout the system. DFDD clients that query DFDD 110 toidentify application instances for various purposes (e.g., to store anew object 30 or to update a keymap entry 140) may then be presentedwith state information about the new application instance as well as anyexisting ones.

It is also noted that in the embodiments described above, applicationinstance state changes relating to failure detection and discovery maypropagate throughout a system without intervention on the part of theapplication instances or the DFDD clients that reference thoseinstances. That is, a given application instance need only know how toconvey heartbeat information to one instance of DFDD 110. It does notneed to have knowledge of all instances of DFDD 110 within the system,of other application instances, or of the various clients that mayinvoke the given application instance. Similarly, DFDD clients do notneed to have independent knowledge of other clients or of all theapplication or DFDD instances within the system; clients may rely on theinstance of DFDD 110 with which they communicate to obtain reasonablycurrent information on the state of resources available within thesystem. By permitting the state of application instances to changewithout requiring other application instances or clients to beimmediately notified of such changes, DFDD 110 may facilitate thescalability of the storage service system.

Storage Classes

In some storage service system embodiments, objects 30 may be treateduniformly with respect to their degree of replication, the distributionof replicas among areas 310, the type of storage resources to whichreplicas are stored, and/or other system features or policies. Forexample, the system may attempt to replicate every object 30 the samenumber of times to the same number of distinct areas 310. However,different clients 50 may have different storage requirements fordifferent objects 30. For example, one client 50 may wish to store aparticular object 30 with a higher degree of reliability (e.g., in termsof numbers and distribution of replicas) than the default storagepolicies may provide, while another client 50 may not require even thedefault level of reliability. Alternatively, a client 50 may wish toincrease object write performance by limiting the number of areas 310 towhich object replicas are distributed, at the possible expense ofreliability.

Correspondingly, in one embodiment a storage service system such as thatof FIG. 2 may be configured to support storage classes of objects 30.Generally speaking, a storage class of a given object 30 may specify anyset of storage service system features or characteristics that affectthe service level agreement (SLA) with respect to the given object 30. Aservice level agreement may generally reflect the set of assurances orexpectations under which a service provider offers services to a client,in exchange for some consideration received from the client (e.g., feesor any other suitable type of consideration). For example, an SLA forobjects 30 managed by a storage service system may specify variouslevels of object reliability, availability, access performance (e.g.,latency, bandwidth), fees or rates for services, or any other measurableaspects of a client's interaction with an object 30. In someembodiments, a storage class may specify only a particular subset of SLAcharacteristics (e.g., number and distribution of object replicas asdiscussed below), while in other embodiments, a storage class maycorrespond directly to a comprehensive SLA that encompasses all definedaspects of the SLA agreement with respect to a given object 30.

In one embodiment, a storage service system may define a fixed set ofstorage classes each having specific defined SLA characteristics, andclients 50 may choose to associate specific objects 30 with particularstorage classes. For example, a default storage class may specify thatan object 30 will be replicated at least three times to at least twodifferent areas 310. A high-reliability storage class may specify thatan object 30 will be replicated at least five times to at least threedifferent areas 310. A budget storage class may specify that a singlereplica of an object 30 will be stored in a single area 310. A localstorage class may specify that an object 30 will be replicated at leastthree times to a single area 310. In other embodiments, a storageservice system may define storage classes having other characteristics,or may allow a client 50 to customize a storage class for a given object30 by specifying a combination of storage policies (e.g., as describedabove with respect to nodepicker 130) to be applied to the given object30.

As mentioned above, SLA characteristics may extend beyond numbers ofreplicas and numbers of areas to which replicas should be distributed.In one embodiment, an SLA characteristic of a particular storage classmay include an indication of an expected processing latencycorresponding to objects 30 associated with the particular storageclass. For example, one storage class may specify a low expectedprocessing latency for a given cost while another may specify a higherexpected processing latency for a lower cost. Different levels ofexpected processing latency may be implemented in a variety of ways. Forexample, from the perspective of a given coordinator 120, some nodes 160may exhibit lower access latency than others, due to factors such as theproximity of nodes 160 to given coordinator 120, the level and type ofresources available at nodes 160, the processing load of nodes 160, orother relevant factors. Thus, subject to the constraints implemented byother SLA characteristics specified by a given storage class, in someembodiments coordinator 120 and/or nodepicker 130 may be configured tochoose nodes 160 that exhibit lower access latency for objects 30 in astorage class that specifies a lower expected processing latency. Inother embodiments, coordinator 120 may be configured to prioritizeprocessing of client access requests to objects 30 according to theexpected processing latencies of the storage classes associated with theobjects 30. For example, coordinator 120 may implement distinct queuesor other processing control or data structures configured to biasprocessing in favor of storage classes having lower expected processinglatency, while ensuring that requests to storage classes having higherexpected processing latency eventually complete.

A storage class may be specified by a client 50 at the time an object 30is initially stored within the storage service system. Alternatively, insome embodiments a client 50 may change the storage class associatedwith an object 30 at any time while the object 30 exists within thestorage service system. If no storage class is specified by a client 50when an object 30 is initially stored, a default storage class such asthe one described above may be used. As described above, in someembodiments the storage class of an object 30 may be stored within akeymap record 148 associated with the key of the object 30. In suchembodiments, coordinator(s) 120 and/or replicator 180 may be configuredto take the storage class of an object 30 into account when storing,replicating and maintaining existing replicas of the object 30. It iscontemplated that clients 50 may be charged different usage costs forobjects 30 associated with different storage classes. For example, ahigh-reliability storage class may generally use more system resources,while a budget storage class may use fewer resources. Correspondingly,for an object 30 of a given size, a client 50 may be charged more forstoring the object 30 using the former storage class, and less for thelatter.

One embodiment of a method of operation of storage classes within astorage service system is illustrated in FIG. 26. In the illustratedembodiment, operation begins in block 2600 where a client 50 specifies astorage class to be associated with a particular object 30.Subsequently, the storage class is persistently associated with theparticular object 30 within the storage service system (block 2602). Forexample, an indication of the storage class may be stored in a datastructure associated with the particular object 30, such as keymaprecord 148, by a coordinator 120 on behalf of the client 50. The stateof the object data associated with the object 30 is then configuredaccording to the characteristics of the specified storage class (block2604). For example, if the storage class specifies certain requirementsfor numbers and/or distribution of object replicas among areas 310,coordinator 120 and/or replicator 180 may operate to generate anddistribute the necessary replicas such that the resulting state of thestorage system with respect to the particular object 30 satisfies therequirements of the storage class. In some embodiments, replicator 180may be configured to ensure that storage class requirements for anobject 30 are maintained over time. For example, if replicas fail,replicator 180 may be configured to detect the failure and generateadditional replicas.

It is contemplated that in some embodiments, the storage characteristicsspecified by a given storage class may include distinguishing amongdifferent types of storage resources available via bitstore nodes 160.For example, in some embodiments, some bitstore nodes 160 may includehigher-performance storage devices than others, or an individualbitstore node 160 may include a combination of higher- andlower-performance devices. In such an embodiment, a storage class mayspecify that one or the other type of device should be used for objects30 associated with that class.

Dynamic Replication

As discussed above, in some embodiments nodepicker 130 may be configuredto generate a write plan identifying specific bitstore nodes 160 towhich replicas of a particular object 30 should be written. Such a writeplan may be generated in such a way that various write policies aresatisfied with respect to the particular object 30 once the write planhas been implemented, e.g., by a coordinator 120. For example, thenumber of nodes 160 specified by a write plan may be determinedaccording to a minimum required number of replicas for a particularobject 30, a minimum number of distinct areas 310 over which replicasshould be distributed, or any other storage policy consideration.

In some embodiments, nodepicker 130 may be configured to generate writeplans in a static fashion in which nodes 160 are consistently chosenaccording to a predictable procedure without taking into account thecurrent state of the nodes 160. For example, nodepicker 130 mayconsistently choose the same set of nodes 160 for storing replicas, ormay rotate through a number of nodes 160 in a round-robin fashion.However, in a large-scale implementation, a storage service system mayinclude many nodes 160 that may be operating in considerably dissimilarstates at various times. For example, some nodes 160 may be inoperative,others may be operative but saturated with request activity or have fewfree resources, and still others may be relatively idle or havesubstantial free resources.

Additionally, different nodes 160 may present different levels ofcommunication cost from the perspective of a given coordinator 120 ornodepicker 130. For example, nodes 160 located within the same area 310or datacenter 300 as a coordinator 120 may be accessible via local,low-latency network connectivity. By contrast, nodes 160 located in adifferent area 310 or data center 300 from a coordinator 120 may presentsubstantially higher access latency than local nodes 160. Moreover, insome embodiments, communication between areas 310 or data centers 300may take place over communication networks having different economiccost models than local communication. For example, communication withinan area 310 may take place over a private local area network (LAN)having plentiful bandwidth for which there is no usage-based charge fordata transmission. By contrast, communication between data centers 300may take place over facilities such as leased telecommunicationfacilities, the public Internet, private wide area network (WAN)facilities or other long-haul communication networks. These facilitiesmay typically be more bandwidth-constrained than LAN facilities, and insome instances may present utilization costs (e.g., based on peak oraggregate bandwidth utilization) charged by third parties that may notbe applicable to LAN communication.

Both the operating state of various nodes 160 as well as the costs ofcommunication to those nodes may vary over time. For example, a node 160that is operative or idle at one time may become inoperative or busy ata later time, or vice versa. Similarly, communication costs such aslatency and/or economic costs may be higher during some periods andlower in others (e.g., during periods of peak vs. off-peak utilization).Because of this variability, a write plan that is efficient and low incost at one time may be considerably less efficient, higher in cost, oreven infeasible at another time (e.g., if nodes 160 specified in thewrite plan become busy, slow to communicate or inoperative).

Thus, in some embodiments, nodepicker 130 may be configured todynamically determine a given write plan for writing replicas of a givenobject 30 according to current state information associated with nodes160. Generally speaking, a dynamically determined write plan may takeinto account observable dynamic state information regarding nodes 160.That is, a dynamically determined write plan may be generated as afunction of node state information that may change over time. Thus, adynamically determined write plan for a given object 30 may itselfchange over time depending on the underlying state information of nodes160, in contrast to a statically generated write plan that may bedetermined independent of the state of nodes 160.

As mentioned above, many different types of state information may betaken into account in the dynamic generation of write plans. In general,state information of nodes 160 may include state information regarding agiven node 160 as well as state information regarding communicationresources (e.g., network resources) via which the given node 160 may beaccessible. In various embodiments, state information regarding a givennode 160 may include the operational state of the given node 160, suchas whether the given node 160 (or an application instance associatedwith the node) is in an OK, INCOMMUNICADO or other operational state asindicated by DFDD 110 as described above. State information regarding agiven node 160 may also include load status information that mayindicate the behavior of given node 160 in greater detail than theoperational state information. For example, in various embodiments loadstatus information may indicate a level of processor utilization, memoryutilization, storage device capacity utilization, storage deviceinput/output bandwidth utilization, or network interface bandwidthutilization corresponding to a given node 160, or any other measurableaspect of node behavior. As described above, in some embodiments loadstatus information may be available via DFDD 110 in addition tooperational state information.

Communication resource state information, which may also be referred toas network cost information, may include any suitable informationrelative to the state of one or more communication paths to a given node160. In various embodiments, network cost information may indicate thenetwork communication latency associated with conveying a message toand/or from given node 160, which may be expressed in terms of time(e.g., seconds, milliseconds, etc.), number of network hops (e.g.,number of routing steps to convey a message), or another suitablemetric. In one embodiment, network cost information may include anindication of available bandwidth (e.g., rate of data transfer)available for communication with given node 160. In another embodiment,network cost information may include an indication of an economic costassociated with network communication with given node 160. For example,such a cost may be expressed as a rate charged for transmitting orreceiving a certain quantity of data, or any other suitable cost or ratemodel for network communication.

Nodepicker 130 may generally use any suitable function of stateinformation of nodes 160 in dynamically determining a write plan for anobject 30. In some embodiments, storage policies implemented bynodepicker 130 (which may be in addition to or instead of those storagepolicies previously described) may specify guidelines or requirementsfor state information that constrain the nodes 160 that may be eligibleto be included in a write plan for a particular object 30. In variousembodiments, these policies may apply globally (e.g., to all objects30), to a particular set of objects 30 (e.g., objects included in aparticular storage class or bucket, having a common key prefix, orotherwise denoted as members of a set), or to individual objects 30(e.g., in response to a client specifying a particular policy to beassociated with an object 30), or any suitable combination of these. Asan example, a particular storage class may specify a storage policyrequiring that some minimum number of replicas exhibit no more than somemaximum communication latency. Correspondingly, in developing a writeplan for an object 30 in this storage class, nodepicker 130 may beconfigured to select at least some nodes 160 according to whether theysatisfy the specified maximum communication latency.

In some embodiments, nodepicker 130 may also be configured to generate awrite plan according to various types of optimization on node stateinformation. For example, as an alternative to specifying a particularmaximum network cost or other cost associated with a write plan, astorage policy may specify that the cost should be minimized among theresources that are available at a particular time. Correspondingly,nodepicker 130 may be configured to minimize one or more costsassociated with a write plan, for example by selecting nodes 160 havinglower network communication or other associated costs. In someembodiments, such minimization may occur in the presence of otherconstraints, such as other storage policies specifying other node stateinformation requirements.

Additionally, it is noted that in some embodiments, some node stateinformation may vary over time in a predictable fashion. For example,bandwidth costs associated with network communication between datacenters 300 may vary according to well-defined rate schedules. In somesuch embodiments, minimizing a cost associated with a write plan mayinclude identifying a time period during which all or some portion ofthe write plan should be executed, dependent upon the cost associatedwith a particular time period. For example, nodepicker 130 may determinethat bandwidth for communicating with a remote data center 300 will beless expensive at some future time than at the current time, and mayfurther determine that the cost of a write plan including nodes 160 atthe remote data center 300 may be minimized by performing at least thosestorage operations directed to the remote data center at the identifiedfuture time. One possible outcome of this process is that the write plangenerated by nodepicker 130 may indicate that generation of some (orpossibly all) replicas of a given object 30 should be deferred until theidentified future time.

It is possible that many different storage policies may apply to aparticular object 30. Further, in some instances, it may not be possibleto generate a single write plan that satisfies each storage policyassociated with particular object 30. For example, storage policiesassociated with particular object 30 may specify that a minimum numberof replicas should be stored and distributed among a minimum number ofdistinct areas 310. However, at a time when a write plan is generatedfor particular object 30, the area 310 in which nodepicker 130 isexecuting may be temporarily isolated from other areas 310 due to atransient communication failure. Consequently, it may be at leasttemporarily impossible to successfully distribute replicas to otherareas 310 in satisfaction of the corresponding storage policy.

In one embodiment, nodepicker 130 may be configured to dynamicallydetermine write plans for objects 30 on the basis of maximizing thenumber of storage policies that can be satisfied by the write plan. Inthe presence of suboptimal conditions, this may result in a write planthat represents a “best effort” to satisfy storage policies. Forexample, in the particular scenario just described, the area diversitypolicy may not be satisfiable owing to the communication failure, butthe minimum replication policy may be satisfiable by storing therequired minimum number of replicas of particular object 310 within thelocal area 310. In some embodiments, the maximization of storagepolicies may take place under various constraints. For example, somestorage policies may be identified as mandatory, such that if they arenot satisfiable, a write plan cannot be determined and a correspondingclient request to store an object may fail. Other storage policies mayhave a preference ranking or weighting, such that higher-preferencestorage policies may be chosen over lower-preference policies during themaximization process. In another embodiment, selection of storagepolicies may be performed by maximizing the total weight of a resultingstorage plan (determined on the basis of weights of the satisfiedstorage policies) instead of or in addition to the number of storagepolicies satisfied by the resulting storage plan.

It is noted that the various techniques for dynamically determiningwrite plans for objects 30 need not occur solely when objects 30 areoriginally stored. As described above, in some embodiments replicator180 may be configured to examine keymap entries 144 corresponding toobjects 30 to determine whether replicas of objects 30 are accessible.If any replicas of a particular object 30 are inaccessible, replicator180 may be configured to request a new write plan from nodepicker 130that may be used to generate additional replicas. The new write plan maybe dynamically determined by nodepicker 130 using any suitablecombination of the techniques described above. Additionally, in someembodiments replicator 180 may be configured to more generally monitorthe compliance of objects 30 with respect to various storage policies.For example, replicator 180 may be configured to determine whether anexisting set of replicas of an object 30 satisfies an area diversitypolicy in addition to a minimum replication policy, or any othersuitable set of policies. In one such embodiment, if replicator 180determines that the number of policies satisfied by the existingreplicas of a particular object 30 is less than some threshold value,replicator 180 may request a new storage plan from nodepicker 130 thatmay be dynamically determined to maximize the number of satisfiedstorage policies as described above. In alternative embodiments,replicator 180 may request a new storage plan upon determining that aparticular mandatory storage policy is no longer satisfied, or upondetermining that a total weight of satisfied storage policies fallsbelow a threshold weight.

FIG. 27 illustrates one embodiment of a method of dynamicallydetermining a write plan for storing one or more replicas of a dataobject according to current state information of bitstore nodes 160. Inthe illustrated embodiment, operation begins in block 2700 where aclient request to store a given object 30 is received. In oneembodiment, such a request may be received according to a web servicesprotocol via web services interface 100, as described in detail above.

Subsequently, a write plan for storing replicas of given object 30 isdynamically determined according to current state information ofbitstore nodes 160 (block 2702). For example, nodepicker 130 may beconfigured to determine a write plan according to various storagepolicies that may apply to given object 30, where the policies take intoaccount any suitable current state information such as node operationalstatus, node load status information, network communication cost, or anyother suitable state information such as described in detail above.Additionally, as described above, in some embodiments dynamicallydetermining a write plan may include optimization with respect to stateinformation or storage policies, such as by minimizing a cost associatedwith the write plan or maximizing a number or weight of storage policiessatisfied by the write plan.

Replicas of given object 30 are then stored to one or more of bitstorenodes 160 according to the dynamically determined write plan (block2704). For example, coordinator 120 may be configured to generatebitstore object put operations directed to individual bitstore nodes 160specified in the write plan, as described above. In some embodiments,some storage operations of the write plan may be executed at differenttimes than other operations, as described above.

As mentioned previously, in some embodiments a write plan may bedynamically determined with respect to an object 30 for which one ormore replicas have already been stored among bitstore nodes 160. FIG. 28illustrates one embodiment of such a method. In the illustratedembodiment, operation begins in block 2800 where one or more existingreplicas of a given object 30 are examined. For example, as describedabove, one embodiment of replicator 180 may be configured to determinewhether existing replicas of given object 30 are accessible, and/or theextent to which existing replicas of given object 30 satisfy storagepolicies associated with the object.

In response to examining replicas of given object 30, it may bedetermined that one or more additional replicas need to be generated(block 2802). For example, existing replicas may have failed orotherwise become inaccessible, resulting in there being fewer than aminimum number of replicas. Alternatively, the state of existingreplicas may be deficient with respect to one or more storage policies.Subsequently, a write plan for storing additional replicas of givenobject 30 is dynamically determined according to current stateinformation of bitstore nodes 160 (block 2804). Such a write plan may bedetermined in a manner similar to that previously described, oraccording to any suitable variations thereof. It is noted that in someembodiments, if it is determined that no additional replicas need to begenerated for given object 30, a write plan may not be determined.

Replicas of given object 30 are then stored to one or more of bitstorenodes 160 according to the dynamically determined write plan (block2806). For example, replicator 180 may be configured to generatebitstore object put operations directed to individual bitstore nodes 160specified in the write plan, as described above, or may simply directone or more nodes 160 storing existing replicas of given object 30 tocopy their replicas to the one or more nodes 160 specified in the writeplan.

Exemplary Computer System Embodiment

It is contemplated that in some embodiments, any of the methods ortechniques described above may be implemented as program instructionsand data capable of being stored or conveyed via a computer-accessiblemedium. Such methods or techniques may include, for example and withoutlimitation, the functions of storage clients 50, web services platform100, DFDD 110, coordinator(s) 120, nodepicker 130, keymap instance(s)140, bitstore node(s) 160, replicator 180 and/or replicator keymap 190.Such methods or techniques may further include any of the methodsillustrated in FIGS. 6-9, 13-15, 20-22 and 25-28 and any suitablevariations thereof. Such program instructions may be executed to performa particular computational function, such as a particular method orportion of a method described above, as well as to provide more generaloperating system functionality, application functionality, and/or anyother suitable functions. It is noted that in some embodiments,components or methods described above as distinct may in otherembodiments be integrated into fewer entities than those shown, orfunctionality may be partitioned differently across components ormethods from the partitioning described above.

One exemplary embodiment of a computer system includingcomputer-accessible media is illustrated in FIG. 29. Such a system mayalso be referred to as a node. As discussed previously, in oneembodiment the functionality of any of the various storage systemcomponents described above may be distributed across a number of nodes,such that a given component may be implemented by one or more nodes orpartitioned across several nodes. While in some embodiments, a node mayexclusively implement the functions of a single storage service systemcomponent, in other embodiments a node may implement the functionalityof all or portions of several different system components. In theillustrated embodiment, computer system 2900 includes one or moreprocessors 2910 coupled to a system memory 2920 via an input/output(I/O) interface 2930. Computer system 2900 further includes a networkinterface 2940 coupled to I/O interface 2930.

In various embodiments computer system 2900 may be a uniprocessor systemincluding one processor 2910, or a multiprocessor system includingseveral processors 2910 (e.g., two, four, eight, or another suitablenumber). Processors 2910 may be any suitable processor capable ofexecuting instructions. For example, in various embodiments processors2910 may be a general-purpose or embedded processor implementing any ofa variety of instruction set architectures (ISAs), such as the x86,PowerPC, SPARC, or MIPS ISAs, or any other suitable ISA. Inmultiprocessor systems, each of processors 2910 may commonly, but notnecessarily, implement the same ISA.

System memory 2920 may be configured to store instructions and dataaccessible by process 2910. In various embodiments, system memory 2920may be implemented using any suitable memory technology, such as staticrandom access memory (SRAM), synchronous dynamic RAM (SDRAM),nonvolatile/Flash-type memory, or any other type of memory. In theillustrated embodiment, program instructions and data implementingdesired functions, such as any of those storage service systemcomponents and other functions described in detail above, are shownstored within system memory 2920 as code 2925.

In one embodiment, I/O interface 2930 may be configured to coordinateI/O traffic between processor 2910, system memory 2920, and anyperipheral devices in the device, including network interface 2940 orother peripheral interfaces. In some embodiments, I/O interface 2930 mayperform any necessary protocol, timing or other data transformations toconvert data signals from one component (e.g., system memory 2920) intoa format suitable for use by another component (e.g., processor 2910).In some embodiments, I/O interface 2930 may include support for devicesattached through various types of peripheral buses, such as a variant ofthe Peripheral Component Interconnect (PCI) bus standard or theUniversal Serial Bus (USB) standard, for example. In some embodiments,the function of I/O interface 2930 may be split into two or moreseparate components, such as a north bridge and a south bridge, forexample. Also, in some embodiments some or all of the functionality ofI/O interface 2930, such as an interface to system memory 2920, may beincorporated directly into processor 2910.

Network interface 2940 may be configured to allow data to be exchangedbetween computer system 2900 and other devices attached to a network,such as other computer systems, for example. In various embodiments,network interface 2940 may support communication via wired or wirelessgeneral data networks, such as any suitable type of Ethernet network,for example; via telecommunications/telephony networks such as analogvoice networks or digital fiber communications networks; via storagearea networks such as Fibre Channel SANs, or via any other suitable typeof network and/or protocol.

In some embodiments, system memory 2920 may be one embodiment of acomputer-accessible medium configured to store program instructions anddata as described above. However, in other embodiments, programinstructions and/or data may be received, sent or stored upon differenttypes of computer-accessible media. Generally speaking, acomputer-accessible medium may include storage media or memory mediasuch as magnetic or optical media, e.g., disk or CD/DVD-ROM coupled tocomputer system 2900 via I/O interface 2930. A computer-accessiblemedium may also include any volatile or non-volatile media such as RAM(e.g. SDRAM, DDR SDRAM, RDRAM, SRAM, etc.), ROM, etc, that may beincluded in some embodiments of computer system 2900 as system memory2920 or another type of memory. Program instructions and data stored viaa computer-accessible medium may be transmitted by transmission media orsignals such as electrical, electromagnetic, or digital signals, whichmay be conveyed via a communication medium such as a network and/or awireless link, such as may be implemented via network interface 2940.

Although the embodiments above have been described in considerabledetail, numerous variations and modifications will become apparent tothose skilled in the art once the above disclosure is fully appreciated.It is intended that the following claims be interpreted to embrace allsuch variations and modifications.

What is claimed is:
 1. A system, comprising: a storage system comprisinga plurality of storage nodes that include one or more respective storagedevices, wherein the storage system is configured to store a pluralityof data objects according to an encoding scheme such that eachrespective data object of the plurality of data objects is stored as arespective plurality of shards, and wherein the respective data objectcan be reconstructed from a fewer number of shards than a total numberof shards for that data object; and a storage manager implemented by oneor more hardware processors and configured to: receive, from a clientvia an application programming interface (API) for accessing a datastorage web service, a web services call that includes a request tostore a particular data object in the storage system; and based on therequest from the client, request that the storage system store theparticular data object according to the encoding scheme as acorresponding plurality of shards; receive, from a different client viathe API for accessing the data storage web service, a web services callthat includes a request to store a different data object in the storagesystem; and based on the request from the different client, request thatthe storage system store the different data object according to adifferent scheme that has a different level of fault tolerance than theencoding scheme for the data object.
 2. The system of claim 1, whereinthe storage manager is further configured to encode the data objectaccording to the encoding scheme comprising dividing the particular dataobject into the corresponding plurality of shards such that theparticular data object can be reconstructed from the fewer number ofshards than a total number of shards for the particular data object. 3.The system of claim 1, wherein the storage system is configured to storeeach shard of the plurality of shards for each respective data object ata different one of the plurality of storage nodes than any other shardof the plurality of shards for the respective data object.
 4. The systemof claim 1, wherein the web services call specifies an identifier of theparticular data object, and wherein, to retrieve a subset of theplurality of shards, the storage manager is configured to specify a keyindicated by the identifier.
 5. The system of claim 1, wherein thestorage manager is configured to request that the storage system storethe particular data object according to the encoding scheme based on therequest from the client specifying that the particular data object bestored according to the encoding scheme.
 6. The system of claim 1,wherein the storage manager is further configured to, based on therequest from the client, request that the storage system store theparticular data object according to a different scheme, wherein thedifferent scheme is associated with a lower level of fault tolerancethan the encoding scheme.
 7. The system of claim 1, wherein thecorresponding plurality of shards corresponds to multiple individualcomplete copies of the data object.
 8. A method, comprising: performing,by a storage manager implemented by one or more hardware processors:receiving, from a client via an application programming interface (API)for accessing a data storage web service, a web services call thatincludes a request to store a particular data object in a storagesystem, wherein the storage system comprises a plurality of storagenodes that include one or more respective storage devices, wherein thestorage system stores a plurality of data objects according to anencoding scheme such that each respective data object of the pluralityof data objects is stored as a respective plurality of shards, andwherein the respective data object can be reconstructed from a fewernumber of shards than a total number of shards for that data object; andbased on the request from the client, requesting that the storage systemstore the particular data object according to the encoding scheme as thecorresponding plurality of shards receiving, from a different client viathe API for accessing the data storage web service, a web services callthat includes a request to store a different data object in the storagesystem; and based on the request from the different client, requestingthat the storage system store the different data object according to adifferent scheme that has a different level of fault tolerance than theencoding scheme for the data object.
 9. The method of claim 8, furthercomprising encoding, by the storage manager, the data object accordingto the encoding scheme comprising dividing the particular data objectinto the corresponding plurality of shards that the particular dataobject can be reconstructed from the fewer number of shards than a totalnumber of shards for the particular data object.
 10. The method of claim8, wherein the storage system stores each shard of the plurality ofshards for each respective data object at a different one of theplurality of storage nodes than any other shard of the plurality ofshards for the respective data object.
 11. The method of claim 8,wherein the web services call specifies an identifier of the particulardata object, and wherein, to retrieve the subset of the plurality ofshards, the storage manager specifies a key indicated by the identifier.12. The method of claim 8, further comprising requesting, by the storagemanager, that the storage system store the particular data objectaccording to the encoding scheme based on the request from the clientspecifying that the particular data object be stored according to theencoding scheme.
 13. The method of claim 8, further comprising, based onthe request from the client, requesting, by the storage manager, thatthe storage system store the particular data object according to adifferent scheme, wherein the different scheme is associated with alower level of fault tolerance than the encoding scheme.
 14. The methodof claim 8, wherein the corresponding plurality of shards corresponds tomultiple individual complete copies of the data object.
 15. One or morenon-transitory computer-accessible storage media storing programinstructions that when executed on or across one or more processorscause the one or more processors to implement a storage manager to:receive, from a client via an application programming interface (API)for accessing a data storage web service, a web services call thatincludes a request to store a particular data object in a storagesystem, wherein the storage system comprises a plurality of storagenodes that include one or more respective storage devices, wherein thestorage system stores a plurality of data objects according to anencoding scheme such that each respective data object of the pluralityof data objects is stored as a respective plurality of shards, andwherein the respective data object can be reconstructed from a fewernumber of shards than a total number of shards for that data object; andbased on the request from the client, request that the storage systemstore the particular data object according to the encoding scheme as acorresponding plurality of shards receive, from a different client viathe API for accessing the data storage web service, a web services callthat includes a request to store a different data object in the storagesystem; and based on the request from the different client, request thatthe storage system store the different data object according to adifferent scheme that has a different level of fault tolerance than theencoding scheme for the data object.
 16. The one or more storage mediaas recited in claim 15, wherein the program instructions when executedon or across one or more processors cause the one or more processors toimplement the storage manager to: encode the data object according tothe encoding scheme comprising dividing the particular data object intothe corresponding plurality of shards such that the particular dataobject can be reconstructed from the fewer number of shards than a totalnumber of shards for the particular data object.
 17. The one or morestorage media as recited in claim 15, wherein the program instructionswhen executed on or across one or more processors cause the one or moreprocessors to implement the storage manager to: store each shard of theplurality of shards for each respective data object at a different oneof the plurality of storage nodes than any other shard of the pluralityof shards for the respective data object.
 18. The one or more storagemedia as recited in claim 15, wherein the web services call specifies anidentifier of the particular data object, and wherein, to retrieve thesubset of the plurality of shards, the program instructions whenexecuted on or across one or more processors cause the one or moreprocessors to: implement the storage manager to specify a key indicatedby the identifier.
 19. The one or more storage media as recited in claim15, wherein the program instructions when executed on or across one ormore processors cause the one or more processors to implement thestorage manager to: request that the storage system store the particulardata object according to the encoding scheme based on the request fromthe client specifying that the particular data object be storedaccording to the encoding scheme.
 20. The one or more storage media asrecited in claim 15, wherein the program instructions when executed onor across one or more processors cause the one or more processors toimplement the storage manager to: based on the request from the client,request that the storage system store the particular data objectaccording to a different scheme, wherein the different scheme isassociated with a lower level of fault tolerance than the encodingscheme.